Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy am I getting all these errors?
    primarykey
    data
    text
    <p>Sorry if this seems pretty dumb but simple but I can't seem to figure out why I am getting these errors: </p> <p>Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\EasyPHP-5.3.9\www\Image Upload\func\user.func.php on line 25</p> <p>Notice: Undefined index: user_id in C:\Program Files (x86)\EasyPHP-5.3.9\www\Image Upload\register.php on line 37</p> <p>Here is the code for each file</p> <p>user.func.php:</p> <pre><code>function user_exists($email){ $email = mysql_real_escape_string($email); $query = mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `email` = `$email`"); return (mysql_result($query, 0) == 1) ? true : false; } </code></pre> <p>and here is register.php:</p> <pre><code>if (isset($_POST['register_email'], $_POST['register_name'], $_POST['register_password'])){ $register_email = $_POST['register_email']; $register_name = $_POST['register_name']; $register_password = $_POST['register_password']; $errors = array(); if(empty($register_email) || empty($register_name) || empty($register_password)){ $errors[] = 'All fields must be filled out'; } else{ if(filter_var($register_email, FILTER_VALIDATE_EMAIL) === false){ $errors[] = 'Email address not valid'; } if(strlen($register_email) &gt; 255 || strlen($register_name) &gt; 35 || strlen($register_password) &gt; 35){ $errors[] = 'One or more fields contains too many characters'; } if(user_exists($register_email) === true){ $errors[] = 'That email has already been registered to another user'; } } if(!empty($errors)){ foreach ($errors as $error){ echo $error, '&lt;br /&gt;'; } } else { $register = user_register($register_email, $register_name, $register_password); $SESSION['user_id'] = $register; echo $_SESSION['user_id']; } } </code></pre> <p>Thanks for any help! -TechGuy24</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload