Code below is working fine in Apache,PHP4,MySQL on Win2k.
I'm getting Warning: mysql_result(): supplied argument is not a valid MySQL result resource when running on the live Unix Server.
The error is coming from the printf statement (second line from bottom below)
Can anybody indicate how to fix it. Thanks
Conor O'Kelly
---------------------------------
<?php
$ArticleID = $_GET['ArticleID'] ;
$result = mysql_query("SELECT articles.ArticleID, articles.Article, articles.ShortTitle FROM articles WHERE ArticleID='$ArticleID' ",$db);
echo "<table border=0 width=800 cellspacing=0 cellpadding=0>
<tr>
<td width=800 bgcolor=#FFCC00><img border=1 src=../images/banner2.jpg></td>
</tr>
</table>" ;
echo "<table border=0 width=800 height=100% cellspacing=0 cellpadding=0 valign=top align=left>
<tr>
<td width=171 valign=top rowspan=2 bgcolor=ffffcc><p> </p></td>
<td width=598 height=6% valign=top> <p>You are at: <a href=../index.htm>home</a>><a href=okelly01.php?ArticleID=56>clanns</a>><a href=okelly03.php?ArticleID=55>okelly</a></td>
<td width=32</td>
</tr>
<tr>
<td width=600 valign=top align=left> ";
echo "<h1>";
printf(" %s<br>\n", mysql_result($result,0,"ShortTitle"));
echo "</h1>";
printf Error - argument is not a valid MySQL result resource
Moderator: General Moderators
Your error is actually here
try this put that right after your query
Code: Select all
$result = mysql_query("SELECT articles.ArticleID, articles.Article, articles.ShortTitle FROM articles WHERE ArticleID='$ArticleID' ",$db);try this
Code: Select all
echo ((!$result) ? 'Mysql says: '.myql_error() : '');Warning: mysql_result(): supplied argument is not a valid My
Ok...
Mysql says: No database selected
So i guess it's in the config.php or the upload on to the mySQL server (??)
I'll check with ISP that I've correctly uploaded the data from the test server to the live server...
Is this correct?
thanks for your help
Mysql says: No database selected
So i guess it's in the config.php or the upload on to the mySQL server (??)
I'll check with ISP that I've correctly uploaded the data from the test server to the live server...
Is this correct?
thanks for your help