RE: [PHP] select * From ????

From: Date: Sun, 15 Dec 2002 23:16:52 +0000
Subject: RE: [PHP] select * From ????
Groups: php.general 
Request: Send a blank email to php-general+get-128355@lists.php.net to get a copy of this message
Looks good to me, but as Peter said, see if you really are getting something in ['img'] try print_r($row) or var_dump($row) to make sure -----Original Message----- From: Bruce Levick [mailto:brucel@ispye.com] Sent: Monday, December 16, 2002 10:01 AM To: Martin Towell Subject: RE: [PHP] select * From ???? Here is the display code that I started with. <?php // Request the text From Illustrations table $result = mysql_query( "SELECT * FROM Illustrations"); if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); } // Display the text of each joke in a paragraph while ( $row = mysql_fetch_array($result) ) { print"<td><tr>$row[titletext]<br></td></tr>"; print"<td><tr>$row[img]<br></td></tr>"; } ?> Not sure why it only displays just the titletext. -----Original Message----- From: Martin Towell [mailto:martin.towell@world.net] Sent: Monday, December 16, 2002 8:47 AM To: Bruce Levick; php-general@lists.php.net Subject: RE: [PHP] select * From ???? can you post some more of your code? I think, if it's not too big, the entire while loops Martin -----Original Message----- From: Bruce Levick [mailto:brucel@ispye.com] Sent: Monday, December 16, 2002 9:45 AM To: php-general@lists.php.net Subject: [PHP] select * From ???? Hi, Am just a newbie at this and was going great until I have hit this smell snag. I am connecting to mysql and all works well there. I query a table "Illustrations" ($query = "SELECT * FROM Illustrations";), and want to print the values of two columns ("titletext" & "img")within each row as the request loops. Print "<td><tr>$row[titletext]<br></td></tr>"; Print "<td><tr>$row[img]<br></td></tr>"; The code inplace seems all ok, but for some reason I am only being returned the value of "titletext" and not also the value of "img". Am I to be setting a new value for returning the info within "img"?? (eg $row2). I am sorry if this is hard to understand and also a silly Q, I am two days into learning this stuff. All I want to do is to return these two values from within the table. "titletext" and "img". They are both text fields. Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#128355) next »