So I have a file that is supposed to run a sql query and return the data and then populate a html table but for some reason it is not returning the data, in the sql in database the query does return data but not on my website.
<?php
//run the query
$sql = "SELECT ID, topic_id, name, surveyid, questionid, longdesc, text, first_name , last_name , email
FROM polling_results WHERE 'topic_id' = '147796'
ORDER BY 'id, displayorder'";
$result = mysql_query($sql);
//fetch the results
while ($row = mysql_fetch_array($result))
{
//display the results
echo '<br /><table class="table table-bordered table-condensed">';
echo '<thead><tr>';
echo '<th>Name</th>';
echo '<th>Email</th>';
echo '<th>Question Text</th>';
echo '<th>Answer</th>';
echo '</tr></thead>';
echo '<tbody><tr>';
echo "<td>".$row['first_name']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['longdesc']."</td>";
echo "<td>".$row['text']."</td>";
echo '</tr></tbody></table>';
}
?>
Got it working, thank you for all the help guys/gals.
ORDER BY 'id, displayorder'so that itsORDER BY id, displayorder