-1

I am trying to create a register system, however when I try to submit the regiseration I get an error which states that Warning:

mysql_query() expects parameter 1 to be string, resource given in /LAMP/register.php on line 134.

// Make sure the email address is available:
 $query_verify_email = "SELECT * FROM login WHERE Email ='$Email'";            
$result_verify_email = mysql_query($dbc, $query_verify_email);
 if (!$result_verify_email) { 
 $result_verify_email==false;
  echo ' Database Error Occured ';
  exit();
  }
james_91
  • 27
  • 6
  • Please check mysql_query parameter. Query parameter comes first. For more detail http://php.net/manual/en/function.mysql-query.php – Zealous System Apr 09 '15 at 13:12
  • 1
    Please consult the PHP documentation before posting questions like this. – Daan Apr 09 '15 at 13:13
  • 1
    mysql* is deprecated. Instead use PDO: http://stackoverflow.com/a/60496/3455727 –  Apr 09 '15 at 13:16
  • possible duplicate of [mysql\_fetch\_array() expects parameter 1 to be resource (or mysqli\_result), boolean given](http://stackoverflow.com/questions/2973202/mysql-fetch-array-expects-parameter-1-to-be-resource-or-mysqli-result-boole) – Jonast92 Apr 09 '15 at 13:42

3 Answers3

2

Hi try inverse parameters like this

$result_verify_email = mysql_query($query_verify_email, $dbc);

for reference : http://php.net/manual/fr/function.mysql-query.php

pietro
  • 902
  • 10
  • 22
0

Look at http://php.net/manual/en/function.mysql-query.php.

You should be doing:

mysql_query($query_verify_email, $dbc);

instead.

Also, use mysqli_* functions rather than mysql_* functions since mysql_* functions have been deprecated.

Frank
  • 664
  • 5
  • 15
0

'$Email' should be '.$Email.' note the dots.

Velimir Tchatchevsky
  • 2,812
  • 1
  • 16
  • 21
  • 1
    Actually he's doing it right without dots. If you want to use concatenation you should use `'".$Email."'` – Daan Apr 09 '15 at 13:51