Jump to content

[SOLVED] Whats up with the return of this query?


mike12255

Recommended Posts

I got the following bit of code:

 

<td height="29" colspan="20" background="images/index_35.gif"><a href="math.php">Math Questions: <?php 
	$info = $_GET['id'];
	$nquery = "SELECT * FROM forumtutorial_posts WHERE postid = $info AND area = 'math'";
	echo mysql_query($nquery);

	?></a></td>

 

 

and it outputs the following:

 

Math Questions: Resource id #15

 

were it should output:

 

Math Questions:test

o, i read that (thanks) and came up with this:

 

$info = $_GET['id'];
	$nquery = "SELECT * FROM forumtutorial_posts WHERE postid = $info AND area = 'math'";
	$result = mysql_query(nquery);
	while ($row = mysql_fetch_assoc($result)) {
echo $row['title'];
}

 

and im getting this error:

 

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/schoolw1/public_html/message.php on line 136

 

that line is

while ($row = mysql_fetch_assoc($result)) {

 

but im not sure what my error is.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.