RE: i am lost (php warning)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php
if($_POST['submit'] == '>Log In'){
  $user=$_POST["email"];
  $pass=$_POST["pass"];
  if(!$sql_query = mysql_query("SELECT * FROM cm_customer WHERE
emial='".mysql_real_escape_string($user)."'")){
    //This will let you know if there is an error in your query. I do
not recomend leaving this here when when it is live.
    die(mysql_error());
  }
  $numRows = mysql_num_rows($sql_query);
  if (($numRows) >0){ 
    $valid = $user;
    session_start();
    session_register("valid");
  }
}
if (session_is_registered("reg")){
  echo "ok";
}else{
  echo "sorry";
}
?>

Jeremy Shovan
 
-----Original Message-----
From: Earl Clare [mailto:eclare@xxxxxxxxxxxxx] 
Sent: Monday, January 17, 2005 10:59 PM
To: php-db@xxxxxxxxxxxxx
Subject: i am lost (php warning)

Hi ya'll,

 

I am lost as to why I am getting this error in my script. Can anyone
kindly
explain why this is so.

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /home/cm/public_html/cell/login.php

 

------------------------------------------------------------------------
----
---

                              My script

------------------------------------------------------------------------
----
---

 

 

if($_POST['submit'] == '>Log In')

{

            $user=$_POST["email"];

            $pass=$_POST["pass"];

            $sql_query = mysql_query("SELECT * FROM cm_customer WHERE
emial='$user'");

            $sql_query = mysql_num_rows($sql_query);

 

            if (($sql_query) >0)

{ 

                                    $valid = $user;

                                    session_start();

                                    session_register("valid");

}

}

 

  if (session_is_registered("reg"))

  {

              echo "ok";

  }

 

  else

  {

     echo "sorry";

  }

 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux