View Single Post
Old 11-03-2005, 03:10 PM   #2 (permalink)
ratbastid
Darth Papa
 
ratbastid's Avatar
 
Location: Yonder
You don't have any error checking in your script at all. I like to sanity check things like database connections--print any errors I receive, double check that we actually connected right, etc.

But I think this is simpler than that. When you did "$newarray = mysql_fetch_array($result)", you created an array in $newarray that's indexed NUMERICALLY. You don't really want a normal array here, you want an associative array, and to create that you'd use mysql_fetch_assoc($result).

You could also access the elements of $newarray by the numerical index, of course.
ratbastid is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62