Anwar11 Posted December 3, 2013 Share Posted December 3, 2013 got error in this line :/ $sql = "SELECT * FROM product-categories"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) <-- ( error in this line ) :/ { echo "<tr><td><font color=blue>"; echo "<a href=Items.php?id=".$row['id'].">".$row['id'] . " " . $row['name']. "</a>"; echo "</td></tr>"; } please help Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted December 4, 2013 Share Posted December 4, 2013 Use backticks to escape that dash $sql = "SELECT * FROM `product-categories`"; Quote Link to comment Share on other sites More sharing options...
mike12255 Posted December 4, 2013 Share Posted December 4, 2013 The above solution will work. It is best practice to use underscores ( _ ) rather then dashes for mysqli table names 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.