Re: [PHP] PHP/MySQL Code

2001-04-06 Thread Steve Werby
"long huynh" <[EMAIL PROTECTED]> wrote: > I think the function should be mysql_num_rows. There's an mSQL function > msql_numrows, but for MySQL it needs the second underscore in between 'num' > and 'rows'. > > > $num = mysql_numrows($result); Either will work. mysql_numrows() is the old name of

Re: [PHP] PHP/MySQL Code

2001-04-06 Thread long huynh
I think the function should be mysql_num_rows. There's an mSQL function msql_numrows, but for MySQL it needs the second underscore in between 'num' and 'rows'. > $num = mysql_numrows($result); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

RE: [PHP] PHP/MySQL Code

2001-04-06 Thread Jeff Oien
> "Jeff Oien" <[EMAIL PROTECTED]> wrote: > > This code won't work. I'm trying to get an error if the username > > is entered incorrectly but it won't go through the if brackets. I even > > tried printing out $num and it's 0. I also tried > > if ($num = "0") { > > if ($num = '0') { > > The single

Re: [PHP] PHP/MySQL Code

2001-04-06 Thread Brian S. Dunworth
At 11:51 AM 4/6/01 -0500, Jeff Oien wrote: >if ($num = 0) { > print "error message etc. > exit; >} This "conditional" will always run. you are assigning $num the value of zero within your if() statement, and that assignation actually happens, so the result is "true" and the

RE: [PHP] PHP/MySQL Code

2001-04-06 Thread Jon Haworth
The comparison operator is ==. = means "assign". Try: if ($num == 0) { foo(bar, baz); } AFAIK what your code means is "assign 0 to $num and then, if that worked, print the error message." HTH Jon -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: 06 April 2001

Re: [PHP] PHP/MySQL Code

2001-04-06 Thread Steve Werby
"Jeff Oien" <[EMAIL PROTECTED]> wrote: > This code won't work. I'm trying to get an error if the username > is entered incorrectly but it won't go through the if brackets. I even > tried printing out $num and it's 0. I also tried > if ($num = "0") { > if ($num = '0') { The single "=" sets the var