Multiple Checkboxes and multiple forms

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!

Moderator: General Moderators

User avatar
spedula
Forum Commoner
Posts: 81
Joined: Mon Mar 29, 2010 5:24 pm

Re: Multiple Checkboxes and multiple forms

Post by spedula »

This question should be in a new thread, next time just create a new question, you'll probably get more people answering you that way since they'll see no replies and will want to be "FIRST!!!" on it, lol

I'm assuming that you already have it setup to display all the rows from your table using:

Code: Select all

while($rowdata = mysql_fetch_array($query)) { //do stuff }
Your original query should look something like this then:

Code: Select all

$query = mysql_query("SELECT product, new, price FROM tbl_name")
This way, it will return the value of 'new' as well as all the other content.

Now, in the while loop you have to tell it to do something extra if $rowdata['new'] == yes. That something extra could be:

Code: Select all

echo "<img src='new.jpg' />";
or whatever you want it to do if the item is new.

Play around with it, make some mistakes, learn. :)
weblearner
Forum Newbie
Posts: 20
Joined: Wed Dec 29, 2010 9:01 am

Re: Multiple Checkboxes and multiple forms

Post by weblearner »

hi spedula

thanks for replying, am not very confident yet, let me try and figure out further...
Post Reply