Quantcast
Channel: Ru.Board
Viewing all articles
Browse latest Browse all 1003802

MySQL оператор Or (7) / Натолкните на мысль

$
0
0
Cheery:
<select name='s[s1]'>
<option value='1'>1</option>
</select>
<select name='s[s2]'>
<option value=''></option>
<option value='2'>2</option>
</select>
...

$sq = '';
$allowed_keys = array('s1', 's2');
foreach($_POST['s'] as $key => $value)
{
if (in_array($key, $allowed_keys))
$sql .= ' AND ' . $key . ' = "' . mysql_real_escape_string($value) . '"';
}

не проще что то такое сделать??

Viewing all articles
Browse latest Browse all 1003802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>