i want to say something like this on the results page: <?php //connect to sql first(in my case mysql) mysql_connect($host, $mysqluser, $mysqlpwd)||die(mysql_error()); mysql_select_db($dbname)||die(mysql_error());
//run query now... $query=mysql_query("select * from [your table name here]")||die(mysql_error()); //get everything in the fields from top of table to bottom of //table while($row=mysql_fetch_array($query)) { //put your else-if statement here ?> now try putting your code for the values here <html> <head> <title>the results</title> </head> <body> just put the the variables here... in your list..dont use the {} thing because it might mess up the parser on things and you might not get what you wanted.. so start your list and just dump the variables in as arrays with the element name as the field name in your table.. maybe that might not work but thats the best i could come up with for now ----- Original Message ----- From: "Roger Davis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 2:37 PM Subject: RE: Very basic If statement still not working VERIFIED VARIABLES > In your If statement (if this is still true) you are using... > > > if(($applique == 1) && ($puffyfoam == 0)) etc. > > But in your list you are using > > > <LI>{$row['applique']} Applique</LI> > > <LI>{$row['puffyfoam']} Puffy Foam</LI> > > Since I am seeing bits and pieces of code I am not sure that this is right > but try this. > > Before your if statement use this code.. > > $applique=$row['applique']; > $puffyfoam=$row['puffyfoam']; > echo $applique; > echo $puffyfoam; > > This will tell you if the PHP variables are getting set, and will "probably" > make your if statement work. > > Roger > > -----Original Message----- > From: Stitchin' [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 2:04 PM > To: [EMAIL PROTECTED] > Subject: Very basic If statement still not working VERIFIED VARIABLES > > > Here's what I've got in my form: > > echo "<td><ul><LI><b>{$row['designname']}</LI></b> > <LI><small>{$row['designfile']}</LI> > <LI>{$row['designcomments']}</LI> > <LI>{$row['applique']} Applique</LI> > <LI>{$row['puffyfoam']} Puffy Foam</LI> > <LI>$message1</LI></td></ul>\n"; > > The three designs are coming up: > 1 0 1 Applique > 1 1 0 Puffy Foam > oops oops oops message1 > > This just doesn't make any sense! > > > -----Original Message----- > From: Roger Davis [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 12:50 PM > To: [EMAIL PROTECTED] > Subject: RE: Very basic If statement still not working ???? > > > Why don't you verify what the values are in the variables. If the Variables > are not getting set then you would always see the "oops" in your statement. > Try... > > echo $applique; > echo $puffyfoam; > > Hope this helps > Roger > -----Original Message----- > From: Stitchin' [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 12:01 PM > To: [EMAIL PROTECTED] > Subject: Very basic If statement still not working ???? > > > Boy, this is getting real frustrating ... doesn't this seem to be child's > play? I'm not trying to do anything fancy ... I tried the && and > parentheses suggested below and it still didn't work. I even tried to put > quotes around the zeros and ones thinking maybe the program wasn't > recognizing that they were numbers and it still didn't work ???? > > -----Original Message----- > The PHP logical AND operator is &&. > > Try > if(($applique == 1) && ($puffyfoam == 0)) etc. > > HTH, > Tore. > > ----- Original Message ----- > > > > This is so simple and basic, I must be missing something.... > > > > I have php code for displaying my embroidery designs on the web page. It's > > going through the mySql database and the query to pull up all the designs > > for a chosen category works fine. I have two fields in my database > > called "applique" and "puffyfoam" both are set up as tinyint(1) > > because all I'm storing there is a zero for no and a 1 for yes. > > > > But for the screen output I don't want these codes to show, I'd like a > com- > > ment to show up. So I set up this "if" statement to place the proper > state- > > ment in a variable to be used in my echo statement (if both answers are > no, > > I don't want to print oops, I just put that there to see where stuff was > > happening)... > > > > > > if($applique == 1 and $puffyfoam == 0) > > { > > $message1 = "Digitized for APPLIQUE"; > > } > > elseif($applique == 0 and $puffyfoam == 1) > > { > > $message1 = "Digitized for PUFFY FOAM"; > > } > > elseif($applique == 1 and $puffyfoam == 1) > > { > > $message1 = "Digitized for APPLIQUE and PUFFY FOAM"; > > } > > else > > { > > $message1 = "oops"; > > } > > > > I have three records in this category that I've set up with answers to the > > two fields as 1,1 0,1 and 1,0 to see what message would show .... none > > should show up as "oops" since none are 0,0. I've also put the "applique" > > raw field data in my echo to see if it is pulling up the right answer as > > well ... > > > > The field is showing the correct field info for applique, they're showing > up > > as 1,0,1 BUT every one of the designs are showing the message "oops". > What > > am I doing wrong??? > > > > TIA > > Renee :) > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php