RE: [PHP-DB] i am lost (php warning)

2005-01-18 Thread Earl Clare
Hey thanks guys, the email was the problem
I had emial instead of email

Thanks for the assistance.

-Original Message-
From: Peter Lovatt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 18, 2005 1:45 AM
To: Earl Clare; php-db@lists.php.net
Subject: RE: [PHP-DB] i am lost (php warning)

Hi


it means that the query did not  produce a result - usually this is because
of a problem with the query.

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

I am guessing you misspelt email and this should be

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


if you add an error trap it makes this knd of thing easier to spot

$sql_query = mysql_query(SELECT * FROM cm_customer WHERE email='$user') or
die(mysql_error());


HTH

Peter











 -Original Message-
 From: Earl Clare [mailto:[EMAIL PROTECTED]
 Sent: 18 January 2005 06:59
 To: php-db@lists.php.net
 Subject: [PHP-DB] i am lost (php warning)
 Importance: High


 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-DB] i am lost (php warning)

2005-01-17 Thread Earl Clare
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-DB] multiple checkbox selection for search form

2003-02-18 Thread Earl Clare
hey guys,

I need some assistance here...
I am toying with a search form that will allow the user to select 3 options from a set 
of checkboxes to search by (eg.)

[[ Select any 3 type ]]

[ ] option1   [ ] option2   [ ] option3
[ ] option4   [ ] option5   [ ] option6
[ ] option7   [ ] option8   [ ] option9

what I would like to do is to allow then to select only 3 options
then search the database for the 3 options selected.

thanks in advance.






[PHP-DB] using more that 2 conditions to obtain info from db

2002-09-26 Thread Earl Clare

hi everyone,

I am new to all php and mySQL.
What i am trying to do is to obtain information from the db using 3 conditions.
this is what i've got

$sql_num = mysql_query(SELECT * FROM siteinfo WHERE dive_operator = '1' AND status = 
'1',$db) or die (mysql_error());

the 3 conditions i need is

dive_operator=1
destination=whatever
status=1

how can i add destination=whatever to the mix?

thanks in advance for your assistance.