PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I would like to pull info from a mysql table very specifically.
I have a form that submits the following to the db:
-Name
-Address
-City
-State
-Zip
Now i want to use a form that will draw all listings based on the first 4 digits of the zip, so I have a form that allows them to put in the zip, on the action page it changes to:
When you loop through the results, instead of echoing the result data, echoing out a form with the data. I would recommend you give each form a unique ID.
Everah wrote:When you loop through the results, instead of echoing the result data, echoing out a form with the data. I would recommend you give each form a unique ID.
okay, but how would I give it a unique ID if its looping? wait... each has its own unique ID in the table, so I can just have it echo its ID from the db right?
Why not give it a try to test it out? See what works.
PS You're on the right track. Loops work by incrementing in some capacity, so as you run through a loop, you can use the loops increment if it is available to you or you can create one. But try it, then let us know how it is going.