burge124 Posted March 6, 2008 Share Posted March 6, 2008 hi i cant get this query to work any suggestions? $result3 = mysql_query("SELECT * FROM userattampt WHERE chapterid = WHERE UserID = 1017 ORDER BY QuestionID"); Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 6, 2008 Share Posted March 6, 2008 for one you did not define your chapter id its empty Quote Link to comment Share on other sites More sharing options...
burge124 Posted March 6, 2008 Author Share Posted March 6, 2008 sorry its missing a 1 $result3 = mysql_query("SELECT * FROM userattampt WHERE chapterid = 1 WHERE UserID = 1017 ORDER BY QuestionID"); Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 6, 2008 Share Posted March 6, 2008 <?php $qid=$_GET['QuestionID']; $result3 = mysql_query("SELECT * FROM userattampt WHERE chapterid ='1' AND UserID ='1017' ORDER BY $qid"); ?> Quote Link to comment Share on other sites More sharing options...
burge124 Posted March 6, 2008 Author Share Posted March 6, 2008 no that didnt solve it, do i need a join or a "." in the query? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 6, 2008 Share Posted March 6, 2008 no you dont look at the code again Quote Link to comment Share on other sites More sharing options...
burge124 Posted March 6, 2008 Author Share Posted March 6, 2008 the query was fine sorry something else not happening oops Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 6, 2008 Share Posted March 6, 2008 add: <?php mysql_query ("SELECT * FROM userattampt WHERE chapterid ='1' AND UserID ='1017' ORDER BY $qid") or die(mysql_error());?> Quote Link to comment Share on other sites More sharing options...
burge124 Posted March 6, 2008 Author Share Posted March 6, 2008 thanks for your help, from that query posted earlier im asking it to output times, although it keep cuming up with undefined index time & timecount any suggestions? (questiontitle works fine with a similar query) echo "<td>" . $row['TimeCount'] . "</td>"; echo "<td>" . $row['QuestionTitle'] . "</td>"; echo "<td>" . $row['Time'] . "</td>"; Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 6, 2008 Share Posted March 6, 2008 dont know so what does it output ??? Quote Link to comment Share on other sites More sharing options...
burge124 Posted March 6, 2008 Author Share Posted March 6, 2008 it should list from the results of the query in the table userattempt all of the times a user with the id 1017 answering question in chapter 1 but at the moment its causing undefined indexes Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 6, 2008 Share Posted March 6, 2008 try putting ini_set('error_reporting',E_ALL); in your code 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.