Hi,
I modified the code on the following page:
http://www.thescripts.com/serverside...ses/index.html
this is my code:
<?
/* declare some relevant variables */
$DBhost = "localhost" ;
$DBuser = "myusername ";
$DBpass = "password";
$DBName = "webimages" ;
$table = "artwork";
mysql_connect($ DBhost,$DBuser, $DBpass) or die("Unable toconnect to database");
@mysql_select_d b("$DBName") or die("Unable to select database $DBName"); $sqlquery = "SELECT * FROM $table WHERE dateCreated = '2002'";
$result = mysql_query($sq lquery);
$number = mysql_numrows($ result);
$i = 0;
if ($number < 1) {
print "<CENTER><P>The re Were No Results for Your Search</CENTER>";
}
else {
while ($number > $i) {
$theimage = mysql_result($r esult,$i,"image ");
$thetitle = mysql_result($r esult,$i,"title ");
print "<p><b>imag e:</b> $thename<br><b> title:</b>
$thetitle</p>";
$i++;
}
}
?>
and i get this error message when i try to run the code:
Warning: mysql_numrows() : supplied argument is not a valid MySQL result resource in W:\www\dateCrea ted2001.php on line 21
There Were No Results for Your Search
although this says there are no results, there are several images with datCreated 2002 in the table. The "image" field is a tinyblob. This is my first attempt to pull a query through.
Can anyone please see where i'm going wrong?
thanks,
Diz