I keep getting this error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/danielxp/public_html/Plus News 2/display.php on line 209
with this code
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/danielxp/public_html/Plus News 2/display.php on line 209
with this code
| Code: |
| case "addcomment":
$id = (int)$_GET['id']; $name = htmlspecialchars($_POST[name]); $comment = htmlspecialchars($_POST[comment]); $postdate = date("j F Y"); $ip = $_SERVER['REMOTE_ADDR']; if($name==NULL|$comment==NULL) { echo "A field was left blank."; } else $checkname = mysql_query("SELECT username FROM users WHERE username='$name'"); $checkname= mysql_num_rows($checkname); <-- This line if ($checkname>0) { $name = $_POST[name]; $comment = $_POST[comment]; echo "<input name='name' type='hidden' value='$name'> <input name='content' type='hidden' value='$content'>"; echo "This name is password protected, Please enter you password below"; } break; |
