tet3828 Posted October 26, 2006 Share Posted October 26, 2006 Thanks for the responses so far people. I appreacieate you all bearing with me as I reduce the broad nature of my questions by grasping the mysql/PHP concept. Ill admit the last response made very little sense to me prior to my recent trip to the library and some practice coding....Moving right along.here goes:I have a table in mySQL it containsroughly 20 rows or "items" with the following values as columns: NAMEs, CATAGORYs, DESCRIPTIONs , PRICEs and HTTP:// reference to a thumbnailhow should I approach displaying the NAME PRICE AND THUMBNAIL in a borderless table when an item's catagory is selected from a dropdown? Link to comment https://forums.phpfreaks.com/topic/25146-closer-but-no-cigar-php-and-mysql/ Share on other sites More sharing options...
Orio Posted October 26, 2006 Share Posted October 26, 2006 [code]<?phpif(!isset($_POST['submit'])){die("<html><body><form action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\"><select name=\"cat\"><option value=\"cat1\">Cat1</option><option value=\"cat2\">Cat2</option></select><input type=\"submit\" name=\"submit\" value=\"Search!\"></form></body></html>");}//Make sure you are connected to the database$qry = "SELECT NAME,PRICE,HTTP:// FROM `Table_Name` WHERE CATAGORY='".$_POST['cat']."'";$result = mysql_query($qry) or die(mysql_error());echo "<table border=\"0\"><tr><td>Name</td><td>Price</td><td>Thumbnail</td></tr>";while($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>".$row['NAME']."</td>"; echo "<td>".$row['PRICE']."</td>"; echo "<td><img src=\"".$row['HTTP://']." /></td>"; echo "</tr>";}echo "</table>";?>[/code]Orio. Link to comment https://forums.phpfreaks.com/topic/25146-closer-but-no-cigar-php-and-mysql/#findComment-114679 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.