I keep getting the following error:

Warning: Supplied argument is not a valid MySQL result resource in
/home/httpd/html/stats/jobs/listing.php on line 33

Warning: Supplied argument is not a valid MySQL result resource in
/home/httpd/html/stats/jobs/listing.php on line 43

when I try to display the following webpage.  What am I doing wrong?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd";>
<html>
<head>
        <title>Title</title>
</head>
<body>
<?php
$hostName="localhost";
$userName="jeff";
$password="jeff";
$databaseName="jobs";
$tableName="listings";

// connnect to the database
if (!($link=mysql_pconnect($hostName, $userName, $password))) {
        DisplayErrMsg(sprintf("error connecting to host %s by user
%s", $hostName, $userName));
        exit();
}

// select the database
if (!mysql_select_db($databaseName, $link)) {
        DisplayErrMsg(sprintf("Error in selecting %s database",
$databaseName));
        DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link),
mysql_error($link)));
        exit();
}

// send the SQL queries

$result=mysql_query("SELECT * FROM listings WHERE store='West Covina',
$link");

// return how many rows
$num_rows=mysql_num_rows($result);
// check if greater than zero
if($num_rows!=0) {
    printf("<FONT SIZE=+3>West Covina</FONT> <FONT SIZE=-2><I><A
HREF=\"../test/stores.php#WC\">address</A></I></FONT><BR><BR>");
    while ($row=mysql_fetch_array($result)) {
    $store=$rowid["store"];
    $jobdesc=$rowid["jobdesc"];
    printf("<A
HREF=\"mailto:[EMAIL PROTECTED]?subject=$store\%20$jobdesc\";>$jobdesc</A><BR>\n");
    }
}
mysql_free_result($result);

?>

</body>
</html>


Thank you,
Jeff
---
Jeff Grossman ([EMAIL PROTECTED])

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to