Jump to content

Specific data in right order


Matpatnik

Recommended Posts

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 70
This 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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...