0

Below is a piece of code i,ve configured with, It's giving me an
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/****/public_html/****/g.php on line 265. The information stored in the database can accessed be accessed by other pages, using the same code. but its not possible to read database info in "g.php". The problem reports in g.php only.. There is no problem found when i use g.php in the http://localhost , but it araises when I upload it to my website for testing.. Please comment and help me to tacle this problem out..

The screen shot is attached along with this..

if (isset($_GET['PostID'])) {
## Check if board exists
    $getpost = mysql_query("SELECT Title, Timestamp, Body, PostCat1, PostCat2, PostCat3, PostCat4, Author FROM posts WHERE
        PostID='".$_GET['PostID']."' AND Draft=0");
    if (mysql_num_rows($getpost) == 0) {
        $pagetitle =& $language['404'];
        include ('template/header.htm');
        include ('template/404.htm');
		include ('template/footer.htm');
		echo '</div><div id="sidebar">
		<h1>Other Posts..........</h1>				
				<ul class="sidemenu">';
		showfooter();
        exit();
    }
## If the script didn't EXIT(), show the board for the post
    $postcontents = mysql_fetch_array($getpost);
    $pagetitle =& $postcontents['Title'];
    $get_author = mysql_query("SELECT DispName, Bio FROM ".USERS_TBL." WHERE UserID='".$postcontents['Author']."'");
    $author = mysql_fetch_array($get_author);
Attachments msql_error.JPG 11.54 KB
2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by pritaeas
0

Please read this thread. Most likely there is an error in your sql statement.

thanks yaarr.. i'm checking it out.. lemme c it!

0

Thank you my dear.. thank you so much... i really love you!! you took me out of this problem.. oh God!! Actually I'd included another database also in g.php, that's reason behind this bug.. Now after using

echo mysql_error();

syntax, i cud find out that another database mucked up.. it was the reason behind the problem..

Again my sincere thanks... Anyway feel free to visit my website www.tado.in...

Have a gud day!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.