note 30178 deleted from function.array by jsheets
| From: | jsheets@php.net | Date: | Sun, 09 Mar 2003 20:59:07 +0000 |
| Subject: | note 30178 deleted from function.array by jsheets | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-45043@lists.php.net to get a copy of this message | ||
I've found that for some reason when I try to access an array after doing a mysql_query() the
array no longer exists. This is not good! Here's what it looks like:
while($retval < ($searchresults * $loopval)){
reset($goturl);
$showurl = $goturl[$retval];
echo $showurl;
$showthem = mysql_query("SELECT * FROM search WHERE url_id = '$showurl'");
$showrslt = mysql_fetch_row($showthem);
When $showurl appears in the browser from the echo it is the last element in the array. This is
interesting since I reset the array just before getting $showurl. Then, once it hits the query the
array is either empty, or gone completely. I know the array has elements in it because I'm
doing the same thing with echo earlier in the app when the elements are initialized. In the mean
time, something destructive is happening to the array. I may be barking up the wrong tree, but it
looks to me like an array can't be used inside of a while strucutre unless it's created in
it.