Hi, just wondering where I seem to be going wrong? It looks ok to me, I'm fairly new to php so I'm using tutorials.
I keep getting this error:
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in G:\xampp\htdocs\xampp\Assignment\reports.php on line 60
this is a small college project so I know about it being weak against mysql injection.
should be inserting field names from my table anywhere??
<!DOCTYPE html>
<html lang="en">
<head>
<title> Exercise 3</title>
<meta charset="utf-8">
</head>
<body>
<?php
$name = “Frank”;
$age = “28”;
var_dump($name);
echo "<br>";
print_r($name);
echo "<br>";
var_dump($age);
echo "<br>";
?>
</body>
</html>
Check your return values.
mysql_query
:
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.
$userdata = mysql_query($order);
has returned a boolean false
, indicating an error occurred. You've then invoked mysql_fetch_row
and passed that boolean false
in, hence your error.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments