sql - php look in database for data not working -
i'm making quiz webpage connected datbase, code isn't working. have code:
$query = "select `question` `questions` `id` = '1'"; $result = mysql_query($query) or die($query."<br/><br/>".mysql_error()); $question = mysql_result($result, 0); echo $question;
it should in table question id 1 , echo question, possible answers , correct answer. column names are: id, question, a, b, c, d , correct
here how looks in phpmyadmin, since im not allowed post images, here link image. http://i.stack.imgur.com/tnjkd.png
can me???
try this
$query = "select `question` `questions` `id` = '1'"; $result = mysql_query($query) or die($query."<br/><br/>".mysql_error()); $question = mysql_result($result, 0); echo $question['question'];
Comments
Post a Comment