printf Error - argument is not a valid MySQL result resource
Posted: Thu Feb 23, 2006 2:32 pm
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>";
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>";