Current location: Hot Scripts Forums » Programming Languages » PHP » [SOLVED] mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource


[SOLVED] mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

Reply
  #1 (permalink)  
Old 05-04-09, 06:03 AM
Andrew Cade Andrew Cade is offline
New Member
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

PHP Code:

<?

include('connect.php');
$query "SELECT body, title, DATE_FORMAT(date,'%D %M %Y') AS date FROM site_notams WHERE notamid = {$_GET['id']}";
$result_notam mysql_query($query);
$row_notam mysql_fetch_assoc($result_notam);
?>
<html>
<h4>NOTAMs</h4>
<?php do { ?>
    <h3>NOTAM <?php echo $row_notam['title']; ?> <?php echo $row_notam['date']; ?></h3>
    <div class="content-list"><?php echo $row_notam['body']; ?></div>
    <p align="center">[<a href="notams.html">View all NOTAMs</a>]</p>
    <?php } while ($row_notam mysql_fetch_assoc($result_notam)); ?>
</html>
Can you help me please, I am not sure what is wrong here.
EDIT: Would this give me an error 500??

Site: oman-ivao.net/atc
Reply With Quote
  #2 (permalink)  
Old 05-04-09, 06:31 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Are you sure it's actually this script that causes the 500 error, and not an htaccess file?

If you're sure, try using the FULL opening tags for PHP, <?php, rather than the short tags (<?).
Reply With Quote
  #3 (permalink)  
Old 05-04-09, 06:51 AM
Andrew Cade Andrew Cade is offline
New Member
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Nico View Post
Are you sure it's actually this script that causes the 500 error, and not an htaccess file?

If you're sure, try using the FULL opening tags for PHP, <?php, rather than the short tags (<?).
There is no htaccess file, how do I go about making one?
Reply With Quote
  #4 (permalink)  
Old 05-04-09, 11:00 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by Andrew Cade View Post
There is no htaccess file, how do I go about making one?
If you don't have an htaccess file, then it's not the problem.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #5 (permalink)  
Old 05-04-09, 11:29 AM
Andrew Cade Andrew Cade is offline
New Member
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Fixed, missing code at the top of the htaccess file
Reply With Quote
  #6 (permalink)  
Old 05-04-09, 11:38 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Ohh... kay, lol.

Glad you solved it.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] mysql_fetch_row(): supplied argument is not a valid MySQL result resource ladytrupp PHP 3 12-22-08 08:57 PM
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Vyse PHP 5 11-17-08 06:13 PM
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Nikker PHP 9 07-12-06 03:05 AM
mysql_fetch_array(): supplied argument is not a valid MySQL result resource... Dion PHP 3 07-16-04 03:48 AM
Supplied argument is not a valid MySQL result resource help aequo PHP 2 06-15-04 08:13 AM


All times are GMT -5. The time now is 08:35 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.