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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.