try this:
$sql = "SELECT * FROM cm_customer WHERE
emial='$user'";
$sql_query = mysql_query($sql) or die($mysql_error());
bastien
From: "Henrik Hornemann" <HEH@xxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Subject: SV: i am lost (php warning)
Date: Tue, 18 Jan 2005 09:15:01 +0100
Hi,
Probably because $user is not in the database.
Regards Henrik Hornemann
-----Oprindelig meddelelse-----
Fra: Earl Clare [mailto:eclare@xxxxxxxxxxxxx]
Sendt: 18. januar 2005 07:59
Til: php-db@xxxxxxxxxxxxx
Emne: i am lost (php warning)
Prioritet: Høj
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php