From: "James Johnson" <[EMAIL PROTECTED]>

> 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";

You say down below that this query only selects one row...

> $CampusIDList = mysql_query($qCampusID, $CCB) or die(mysql_error());
> $row_CampusIDList = mysql_fetch_assoc($CampusIDList);

and this mysql_fetch_assoc() call will return that one row into
$row_CampusIDList.

> //var_dump($row_CampusIDList);
>
> $tmp = array();
> while( $rowData = mysql_fetch_array( $CampusIDList )) {

This while will never execute as there are no more rows to select.

> //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.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to