#1
|
||
|
mysql_fetch_assoc() - PROBLEM
I'm having a problem with a script on my site, it worked fine, then suddently it stopped. I can't find the problem because of my limited php knowledge. I hope someone can assist me, as this really annnoys the **** out of me lol.
[quote:02321fa4e7]Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/varg/public_html/maps/comment.php on line 52[/quote:02321fa4e7] [code:1:02321fa4e7]<?php function displayComments($id) { /* bring db connection variable into scope */ global $dbh; /* query for comments */ $query = "SELECT *, DATE_FORMAT(date, '%a %m-%d-%Y, %h:%i %p') AS date FROM map_comments WHERE map_id=$id"; $result = mysql_query ($query, $dbh); echo "<BR />\n"; /* display the all the comments */ while ($row = mysql_fetch_assoc ($result)) { echo "<table style=\"border:1px solid #96b4d6\" width=\"300\">\n"; $name = htmlentities ($row['name']); echo "<tr><td><b>by: $name</b>&nbsp;&nbsp;on {$row['date']}</td></tr>\n"; $comment = strip_tags ($row['COMMENT'], '<a><b><i><u>'); $comment = nl2br ($comment); echo "<tr><td>$comment</td></tr>\n"; echo "</table>\n"; echo "<BR />\n"; } } ?>[/code:1:02321fa4e7] line 52= while ($row = mysql_fetch_assoc ($result)) { |
#2
|
||
|
I see no reason asd to why that dosent work. Try changing mysql_fetch_assoc to mysql_fetch_array
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#3
|
||
|
The problem has been sorted out. There was a problem with the $id not being transferred from the links to the script properly. thanks for the help anyway.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
a little problem ... | VooDoo- | Tech Support | 2 | 03-09-2008 11:28 PM |
Problem? | TitaN-R2K | Tech Support | 8 | 08-10-2007 05:48 PM |
Same problem | Leonin | phphq.Net Forums | 0 | 01-27-2005 12:53 AM |
problem | .ringer. | Sigs and Graphics | 5 | 06-17-2004 03:19 PM |
problem here | BOne | Tech Support | 1 | 08-22-2003 01:00 PM |