Re: [PHP-DB] Problems with mysql_num-rows()

2004-10-31 Thread Doug Thompson
The variables are not being expanded. As a minimum, you need to escape the single quotes. $query = "SELECT * from user where name=\'$userid\' and pass=password(\'$password\')" Alternatively, you can concatenate the expanded variables. $query = "SELECT * from user where name='".$userid."' and p

RE: [PHP-DB] Problems with mysql_num-rows()

2004-10-31 Thread Bastien Koert
Very simply, either your connection is messed up, you are not getting a result set back or there is an error in your sql try this: $result = mysql_query($query, $link) or die ("failed because ".mysql_error()); then start debugging bastien From: "Arne Essa Madsen" <[EMAIL PROTECTED]> Reply-To:

Re: [PHP-DB] Something wierd with time() and curdate()

2004-10-31 Thread Jason Wong
On Sunday 31 October 2004 22:45, Bobo Wieland wrote: > There is something wierd going on over here... > > I have a date field, datum, in mysql that I cast to a timestamp and check > against time(). If the datum value is more than one day old the table finds > a new random row and sets the datum fie

Re: [PHP-DB] Problems with mysql_num-rows()

2004-10-31 Thread Jason Wong
On Sunday 31 October 2004 18:32, Arne Essa Madsen wrote: > I have the following problem: > > This one does not work: > $query = "SELECT * from user where name='$userid' and > pass=password('$password')"; print $query; > $result = mysql_query($query, $link); Use mysql_error(). -- Jason Wong

[PHP-DB] Problems with mysql_num-rows()

2004-10-31 Thread Arne Essa Madsen
I have the following problem: This one does not work: $query = "SELECT * from user where name='$userid' and pass=password('$password')"; $result = mysql_query($query, $link); $num_rows = mysql_num_rows($result); I get this error message: Warning: mysql_num_rows(): supplied argument is not a

[PHP-DB] selective query?

2004-10-31 Thread Dan Bowkley
I'm tweaking my internet speed tester thingamabob (http://www.dibcomputers.com/bandwidthmeter/index.php) and am rather stumped. Currently, I'm grouping together all results from each domain (all results from, say, adelphia.net are averaged and displayed as one, etc) and to that end I stopped displ

[PHP-DB] Something wierd with time() and curdate()

2004-10-31 Thread Bobo Wieland
There is something wierd going on over here... I have a date field, datum, in mysql that I cast to a timestamp and check against time(). If the datum value is more than one day old the table finds a new random row and sets the datum field to CURDATE(). Now, this has worked for two years now, but

RE: [PHP-DB] PHP & Javascript

2004-10-31 Thread Mulley, Nikhil
Actaully No , as Javascript has to run at Web Browser end and PHP has to run at Server Side , And more at matter javascript memory ( variable values ) cannot be shared with PHP memory ( variable values ) , If you want want to share the variable values or result values then you can do away with P