Someone please help this 67 year old retired programmer out. I am teaching myself PHP and have run into a problem. It looked like a pretty plain vanilla thing to do, but I am really confused with the results. I have added a table (image_folder) to an existing SQL database. The table is made up of two fields: (1) an auto-incrementing field (Index), and a text field (img_dir) which contains a text pathname (i.e. /image/uploads/outdoor/). I have manually added 23 records to the table using phpMyAdmin. I am using the following code to retrieve the data: $query = "SELECT img_dir FROM ".$glob['dbprefix']."CubeCart_image_folder"; echo $query."<br>"; $result = mysql_query($query); echo "here<br>"; echo $result[0]; if(mysql_error()) { echo mysql_error() } The output from the first debug echo is: SELECT img_dir FROM CubeCart_image_folder (which is correct) The second debug echo does echo "here" to the screen. The third debug echo (attempting to see the first element retrieved) outputs nothing. There is no error output from the mysql_error echo. I would appreciate any suggestions on how to get this stuff out of the db. Thanks, Klaus Cook Houston, Texas
try this $result= mysql_query($query); while ($row = mysql_fetch_assoc($result)) { echo $row['field_name']; } you can also use print_r to print all the keys => value in an array