Matpatnik Posted October 20, 2006 Share Posted October 20, 2006 Hi guys,I'm trying to get some specific data in alphabetical order but a soon as I write WHERE member=1 inside $result it tell me that error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/local/4admin/apache/vhosts/runefr.com/httpdocs/quete/F2p/cookAssistant.php on line 70This is my code: <?php $con = mysql_connect("localhost","***","***"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("***", $con); $result = mysql_query("SELECT * FROM RuneFr_Quete WHERE member=1 ORDER BY quete"); echo "<table> <tr> <th>Les quĂȘte</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['quete'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con);?> I know there is a way of doing it but I don't how.Thank you for your helpMat Link to comment Share on other sites More sharing options...
skym Posted October 20, 2006 Share Posted October 20, 2006 Very probably a query error. What type is `member`? If it's not an integer type, trySELECT * FROM RuneFr_Quete WHERE member='1' ORDER BY quete Link to comment Share on other sites More sharing options...
Matpatnik Posted October 21, 2006 Author Share Posted October 21, 2006 What type is `member`?'member' is juste a VARCHAR(1) to define if the quest in question is for member or not.I already tryed '1' and it doesn't work. but if I take off the WERE member=1 it work just fine except both member and non-member quest are mixed up Link to comment Share on other sites More sharing options...
skym Posted October 21, 2006 Share Posted October 21, 2006 Forgot to mention yesterday, might help to use mysql_error() and see the sql error:$result = mysql_query("SELECT * FROM RuneFr_Quete WHERE member=1 ORDER BY quete") or die('SQL error: '.mysql_error()); Link to comment Share on other sites More sharing options...
Matpatnik Posted October 22, 2006 Author Share Posted October 22, 2006 Hey I find out what was my problem, I misspell member it was supose to be membre So now, next step, I will find a way to add a link to each quest on the server Thank you Skym for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now