sean14592 Posted June 22, 2008 Share Posted June 22, 2008 Hi, Im doing a simple MYSQL query and then echoing on to the page... Here is the mysq connect at the top of the page, I know this works as I do echo out other things and that works.. <?php if (!isset($_GET['id'])) { echo 'NO ID PROVIDED!'; exit(); } if (isset($_GET['id'])){ $id = $_GET['id']; // Make a MySQL Connection mysql_connect("$db_host", "$db_username", "$db_password") or die(mysql_error()); mysql_select_db("$db_database") or die(mysql_error()); // Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM properties where id=$id") or die(mysql_error()); // store the record of the "example" table into $row $row = mysql_fetch_array( $result ); // Print out the contents of the entry ?> Here is the code with somehing wrong, In the database lowprice1 = 1..Yet it is not echoing the row. <table width="100%" border="0"> <tr> <td width="43%"><strong>Season</strong></td> <td width="16%"><strong>From</strong></td> <td width="16%"><strong>To</strong></td> <td width="25%"><strong>Price Per Week</strong></td> </tr> <?php if ($row['lowprice1'] != "") { echo "<tr> <td>Low</td> <td>".$row['lowfromday1']." ".$row['lowfrommonth1']."</td> <td>".$row['lowtoday1']." ".$row['lowtomonth1']."</td> <td>£".$row['lowprice1']."</td> </tr>"; } ?> </table> Any help would be nice. cheers sean Link to comment https://forums.phpfreaks.com/topic/111389-solved-simple-mysql-query-not-working/ Share on other sites More sharing options...
sean14592 Posted June 22, 2008 Author Share Posted June 22, 2008 FIXED! Thanks ppl cheers Link to comment https://forums.phpfreaks.com/topic/111389-solved-simple-mysql-query-not-working/#findComment-571795 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.