little help using an array IN a query
Posted: Mon Sep 08, 2008 12:20 pm
I don't mind if someone could point me to the right tutorial, but i haven't had any luck finding one for this particular issue (either way, i could use a little help):
i've got an array, $offering, which would return something like 03, 04, 08
foreach ($offering as $f) {
$deg = $f;
echo $deg; // gives me 030408 - fine...
}
while
foreach ($offering as $f) {
$deg = $f;
}
echo $deg; // only gives me 08 - so i can only assume that
$result = mysql_query("SELECT COUNT(*) FROM administrators WHERE fice IN (SELECT fice FROM characteristics WHERE carnegie_code = '$carn_class' AND offering = '$deg') ") or die(mysql_error());
is only going to return those with fields 'offering' containing 08...
can someone please show me how to search for ALL the values for that field...?
i really appreciate it...
GN
i've got an array, $offering, which would return something like 03, 04, 08
foreach ($offering as $f) {
$deg = $f;
echo $deg; // gives me 030408 - fine...
}
while
foreach ($offering as $f) {
$deg = $f;
}
echo $deg; // only gives me 08 - so i can only assume that
$result = mysql_query("SELECT COUNT(*) FROM administrators WHERE fice IN (SELECT fice FROM characteristics WHERE carnegie_code = '$carn_class' AND offering = '$deg') ") or die(mysql_error());
is only going to return those with fields 'offering' containing 08...
can someone please show me how to search for ALL the values for that field...?
i really appreciate it...
GN