Maybe a dumb question, but I'm new to PHP and have found myself stuck. I'm trying to use the results from a mysql_fetch_array at another location in my script. I've tried to
do an array_pop on the results from mysql_fetch_array with no luck. I worked around it by creating an array and pushing the the results of the mysql_fetch_array to it. I was then able to use array_pop elsewhere in my sript on my newly created array to get the information. Why didn't array_pop not work with the results of mysql_fetch_array?
This is my sql query and how I got it to work...
$default = @mysql_query("SELECT DISTINCT name FROM images"); //get unique names
while ($uname = @mysql_fetch_array($default)) {
$uidx=$uname["name"];
array_push ($stuff, $uidx);
}
In a separate loop I was able to get the results by doing this
$uid = array_pop ($stuff);
My goal is to get all the unique names from the name column of my table and set them as variables for obtaining specific information about each unique name. The problem is that I never know how many unique results I will get... nor do I have any idea what the results are going to be..... SO I have to pick the results off and handle them one at a time.
HELP! Thanks