put all records into an dynamic array
I am a newbie to PHP and MySQL. I currently do all my stuff in ASP and would like to learn the power of PHP. One of the things I am wondering is if you can do like asp and put all the records into an array so you would loop through the array not each record. I see the function mysql_fetch_array does fetch one row at a time but can I do a dynamic array like this?
Also please fill me in if PHP doesn't really matter if you hit each record since it may be more efficient at this. I don't have a clue. Someone please educate me on this.
Thanks in advance for your help.
Yes, still struggling with this.
Okay. I am finding out that I have now clue about php.
The following suggestions do work but not like I want them to. For some reason I can only loop one time. Yes, I know about the reset function but I keep getting an error saying something about this isn't an array.
Here is what I am trying to do:
I have a table with say 3 fields: ID, Model, Brand
Here is how it might look in the database.
ID - Model - Brand
1 - M1 - Rocka
2 - M2 - Rocka
3 - M3 - Rocka
4 - G43 - Blackbo
I have a .html page with checkboxes and when they select one to four items say 1, 3, and 4 I want the output to be like
Model - M1 - M2 - G43
Brand - Rocka - Rocka- Blackbo
I orginally though I could reset the array created from the mysql_fetch function but it didn't work.
Anyone have any suggestions on how I may do this?
I must say to all you php guru's that the vb .getrows is much simpler and easier to work with.
Thanks.