Aureole Posted July 21, 2007 Share Posted July 21, 2007 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. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 21, 2007 Share Posted July 21, 2007 $result should be $select for this line: while($row = mysql_fetch_array($result)) { Also mysql_select_db does not return any value so need to setup a variable ($which) to hold the returned value. Quote Link to comment Share on other sites More sharing options...
Aureole Posted July 21, 2007 Author Share Posted July 21, 2007 How would I do the second thing you said? Thanks. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 21, 2007 Share Posted July 21, 2007 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') Quote Link to comment Share on other sites More sharing options...
Aureole Posted July 21, 2007 Author Share Posted July 21, 2007 Ok thanks a lot, I'm new to this...making my first script. Quote Link to comment Share on other sites More sharing options...
Aureole Posted July 21, 2007 Author Share Posted July 21, 2007 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. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 22, 2007 Share Posted July 22, 2007 I'm not getting any error when I go to the supplied link. I dont even get any error message at all when I browse around the site either Quote Link to comment Share on other sites More sharing options...
Aureole Posted July 25, 2007 Author Share Posted July 25, 2007 Yeah I fixed it all up now, thanks for checking it out though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.