Jump to content

[SOLVED] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result reso


Aureole

Recommended Posts

I'm getting that error for some reason unknown to me...here's my code.

 

<?php
$h='localhost';
$u='Username';
$p='Password';

$conn = mysql_connect($h, $u, $p)
or die("mysql_connect() - Failure!<br />");
print "mysql_connect() - Success!<br />";

$which = mysql_select_db(veraci7y_website)
or die("mysql_select_db() - Failure!<br />");
print "mysql_select_db() - Success!<br />";

$select = mysql_query("SELECT * FROM news")
or die ("mysql_query() - Failure!<br />");
print "mysql_query() - Success!<br />");

while($row = mysql_fetch_array($result)) {
echo $row['author'];
echo $row['shortstory'];
}

mysql_close($conn);
?>

 

Thanks a lot.

Link to comment
Share on other sites

Oops typo! I meat:

Also mysql_select_db does not return any value so no need to setup a variable ($which) to hold the returned value.

 

Which means change this line

$which = mysql_select_db(veraci7y_website)

to this:

mysql_select_db('veraci7y_website')

Link to comment
Share on other sites

Sorry for double post. Ok well that fixed that but now something strange is happening...

 

At the bottom right of the page I am seeing:

 

IPS Driver Error

There appears to be an error with the database.

You can try to refresh the page by clicking here

 

That's an Invision Power Board error and the thing is...

 

1) My Forum is working fine...

2) My site is connected to my forum in ways like the latest posts are shown on the site and I am using the IPB SDK but they are both working fine so why is there an error.

 

ALSO the error has some style information associated with it so it's messing with my font sizes making everything small.  ???

 

 

http://www.veraci7y.net/index.php just in case.

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.