Hi All,
I try to run script below but i got an error message 'Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/database/detailed.php on line 14'
function connect(){
$link = @mysql_pconnect ("localhost", "username", "password");
if ($link && mysql_select_db("db_name"));
return ($link);
return (FALSE);
}
connect();
$query = "select * from table where id = '$link_id'";
$result = mysql_query($result);
$this = mysql_fetch_array($result);
?>
<html><head><title>Printer Friendly</title></head>
<body>
<?php
print "$this->title <p>";
print "$this->description";
?>
</body></html>
Please help, how to fix it?
Thanks
I try to run script below but i got an error message 'Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/database/detailed.php on line 14'
Code:
<?php function connect(){
$link = @mysql_pconnect ("localhost", "username", "password");
if ($link && mysql_select_db("db_name"));
return ($link);
return (FALSE);
}
connect();
$query = "select * from table where id = '$link_id'";
$result = mysql_query($result);
$this = mysql_fetch_array($result);
?>
<html><head><title>Printer Friendly</title></head>
<body>
<?php
print "$this->title <p>";
print "$this->description";
?>
</body></html>
Please help, how to fix it?
Thanks