RE: [PHP] Code check please
| From: | James Johnson | Date: | Wed, 17 Sep 2003 16:22:25 +0000 |
| Subject: | RE: [PHP] Code check please | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162892@lists.php.net to get a copy of this message | ||
Hmm, ok I took out the
$row_CampusIDList = mysql_fetch_assoc($CampusIDList);
and it works.... But how come?
J
-----Original Message-----
From: James Johnson [mailto:james@primedna.net]
Sent: Wednesday, September 17, 2003 9:17 AM
To: php-general@lists.php.net
Subject: [PHP] Code check please
Hi,
Can anyone see why this code isn't working....
$SID = $_SESSION['svUserID'];
$AdID = $_GET['AdID'];
// get the campuses assigned
$qCampusID = "SELECT inst_id FROM ads_campuses WHERE ad_id = $AdID";
$CampusIDList = mysql_query($qCampusID, $CCB) or die(mysql_error());
$row_CampusIDList = mysql_fetch_assoc($CampusIDList);
//var_dump($row_CampusIDList);
$tmp = array();
while( $rowData = mysql_fetch_array( $CampusIDList )) {
//print("ROW Data $rowData");
if(!in_array($rowData['inst_id'],$tmp)){
$tmp[] = $rowData['inst_id'];
}
}
//var_dump($tmp);
$cidList = implode( ',', $tmp );
//var_dump($cidList);
If I do a var_dump($row_CampusIDList); I get a value, so I know there's data
to work with. But if I do a var_dump($tmp) and var_dump($cidList), they're
both empty.
This particular value query only has 1 inst_id of 100. Other queries with
one value (99,45, etc) will work.
Very strange...
Thanks,
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php