shadowblad3rz Posted June 23, 2013 Share Posted June 23, 2013 (edited) Hey guys i have the code below for mySQL database, but the thing is it won't display on my browser am i doing anything wrong ? The thing im trying to do is display my table records on the browser which it wont do <?php $con = mysql_connect('localhost','username','password'); if (!$con) { die("Could Not Connect: " . mysql_error()); } mysql_select_db("database", $con); $sql = "SELECT * FROM Order_Information"; $myData = mysql_query($sql, $con); echo "<table border=1> <tr> <th>Order ID</th> <th>Order Items</th> <th>Order Quantity</th> </tr>"; while($record= mysql_fetch_array($myData)) { echo "<tr>"; echo "<td>" . $record['Order_ID'] . "</td>"; echo "<td>" . $record['Order_Items'] . "</td">; echo "<td>" . $record['Order_Quantity'] . "</td"> ; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Edited June 23, 2013 by shadowblad3rz Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted June 23, 2013 Share Posted June 23, 2013 you have a couple of " and > reversed on lines 21 and 22, resulting in fatal php parse/syntax error(s) and since your code never runs for fatal parse/syntax errors, there's no output. you need to have php's error_reporting set to E_ALL and display_errors set to ON in your php.ini so that php will report and display all the errors it detects. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.