try just changing mysql_fetch_array to mysql_fetch_assoc
"Bryan" <[EMAIL PROTECTED]> wrote in message
006801c1192c$649f6e30$272478cc@bryanspc">news:006801c1192c$649f6e30$272478cc@bryanspc...
> mysql_fetch_array places 2 records for each one returned (example)
>
> Array
> (
> [0] => 56
> [location_id] => 56
> )
>
> Is there any way to delimate that and have the key present only once?
> here is my code :
>
> /*
> *
> *
> * Start code
> *
> *
> */
>
> while ($aRow = mysql_fetch_array($sResult) ) {
> print_r($aRow);
>
>
> foreach ($aRow as $key => $sValue) {
>
> $sData[$key] = "SELECT * FROM location WHERE region='$sValue' AND region
> !='yes'";
> $sDataResult[$key] = mysql_query($sData[$key], $sDbcnx) or
> die(mysql_error());
>
> /* print Main heading linking to no where */
>
> print "<OPTION VALUE=\"#\">".$sValue."</OPTION>";
>
>
> while($aData[$key] = mysql_fetch_array($sDataResult[$key]) ) {
>
> /* grab the data from the main heading and print all the info for that
> record */
>
> print
> "<OPTIONVALUE=\"indexes/index.php?iLoc_id=".trim($aData[$key]['location_
> id'])."\"> ".trim($aData[$key]['location'])."</OPTION>\
> n";
>
> } /* end while */
>
>
> } /* end foreach */
>
> } /* end main while */
>
> /*
> *
> *
> * End Code
> *
> *
> */
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]