Re: [PHP-DB] mysql_num_rows == 0

2011-05-30 Thread Nazish
Code runs smoothly now, thanks. It's always great to pick up diverse coding tips through the conversations here. 2011/5/30 Nazish > That did the trick: I was over-enthusiastic in my usage of > die(mysql_error). > > I initially used mysql_error to troubleshoot another problem (which has now > re-

Re: [PHP-DB] mysql_num_rows == 0

2011-05-30 Thread Nazish
That did the trick: I was over-enthusiastic in my usage of die(mysql_error). I initially used mysql_error to troubleshoot another problem (which has now re-emerged), but that's a different question which is puzzling me. The error message ($alert = "Username already exists!";) displays on the page

Re: [PHP-DB] mysql_num_rows == 0

2011-05-30 Thread Karl DeSaulniers
try this instead.. if(mysql_num_rows($check) > 0) { //true } else { //false } and yes, Peter's right... please dont make everything die(). Karl On May 30, 2011, at 3:43 PM, Peter Lind wrote: On 30 May 2011 22:31, Nazish wrote: Hi all, I've run into a little barrier, and I'

Re: [PHP-DB] mysql_num_rows == 0

2011-05-30 Thread Peter Lind
On 30 May 2011 22:31, Nazish wrote: > Hi all, > > I've run into a little barrier, and I'm wondering whether you have any > insights. I'm entering values into a MySQL database. Before running the > mysql_query, I'm checking if the value already exists (using mysql_num_rows > == 0).  If the value al

[PHP-DB] mysql_num_rows == 0

2011-05-30 Thread Nazish
Hi all, I've run into a little barrier, and I'm wondering whether you have any insights. I'm entering values into a MySQL database. Before running the mysql_query, I'm checking if the value already exists (using mysql_num_rows == 0). If the value already exists in the database, the page will echo

Fwd: Re: [PHP-DB] mysql_num_rows, resource id #

2008-03-27 Thread Richard Dunne
This much is working: The output is 1 1 which is correct. One small step at a time, hopefully forward. Richard. --- Begin Message --- Richard Dunne wrote: In my code below, I am trying to verify that the query is selecting data from both rows of my answers table. I ha

Re: [PHP-DB] mysql_num_rows, resource id #

2008-03-27 Thread Evert Lammerts
Richard Dunne wrote: In my code below, I am trying to verify that the query is selecting data from both rows of my answers table. I have run the query on my MySQL CLI and getting answers from both rows, but running this script I get $rows = 0. I can't figure out why its not returning 2 for the n

[PHP-DB] mysql_num_rows, resource id #

2008-03-27 Thread Richard Dunne
In my code below, I am trying to verify that the query is selecting data from both rows of my answers table. I have run the query on my MySQL CLI and getting answers from both rows, but running this script I get $rows = 0. I can't figure out why its not returning 2 for the number of rows. It

Re: [PHP-DB] mysql_num_rows

2005-03-08 Thread Martin Norland
Calvin Lough wrote: That means that you dont have any rows to work with. It could mean that you are not connected to the database, or the query you performed did not return any rows. Calvin On Tue, 8 Mar 2005 16:11:10 +0300, Tsegaye Woldegebriel <[EMAIL PROTECTED]> wrote: Dear Sir or Madame, I foun

Re: [PHP-DB] mysql_num_rows

2005-03-08 Thread J. Connolly
Use the mysql_error() function which may give you more answers. In addition you can use something like $num = mysql_num_rows($test); echo $num; If it returns 0 you have no entries, if nothing happens then you have problem with your query or connection. If you get a number then there is somethi

Re: [PHP-DB] mysql_num_rows

2005-03-08 Thread Calvin Lough
That means that you dont have any rows to work with. It could mean that you are not connected to the database, or the query you performed did not return any rows. Calvin On Tue, 8 Mar 2005 16:11:10 +0300, Tsegaye Woldegebriel <[EMAIL PROTECTED]> wrote: > Dear Sir or Madame, > I found the followi

[PHP-DB] mysql_num_rows

2005-03-08 Thread Tsegaye Woldegebriel
Dear Sir or Madame, I found the following error, Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/sitename/dynamicfile.php on line 61 What is the reason? I want anyone who knows to answer to reply me. Thank you in advance for sharing your pr

Re: [PHP-DB] mysql_num_rows

2004-03-03 Thread Craig Hoffman
I got it working! Thanks everyone! __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimb.net _ On Mar 3, 2004, at 2:46 PM, Micah Stevens wrote: the $db variable isn't referencing a

Re: [PHP-DB] mysql_num_rows

2004-03-03 Thread Micah Stevens
the $db variable isn't referencing a proper connection. As you did not create the db connection in this function, I'm assuming it's a scope problem. Make sure that $db is global, and then add a global statement to the first line in the function for this variable. the $db you're referencing in

RE: [PHP-DB] mysql_num_rows

2004-03-03 Thread Hutchins, Richard
y to return any rows. Hope this helps. Rich > -Original Message- > From: Craig Hoffman [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 03, 2004 3:34 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] mysql_num_rows > > > ok, I uncommented the line and change

Re: [PHP-DB] mysql_num_rows

2004-03-03 Thread Craig Hoffman
ok, I uncommented the line and changed a few things around. However I am still getting errors. I really do appreciate everyone's help. Thanks CH Here is the 'new' code: function notify_password($username, $password) // notify the user that their password has been changed { $query ="SEL

Re: [PHP-DB] mysql_num_rows

2004-03-03 Thread Daniel Clark
> $query ="SELECT username FROM users WHERE username=('$username')"; > // $result = mysql_query($query, $db); Above line should be uncommented. > if (!$query) And the "if" checking the number of rows returned from the $result set. -- PHP Database Mailing List (http://www.php.ne

Re: [PHP-DB] mysql_num_rows

2004-03-03 Thread Micah Stevens
because you're supplying it with a string not the result of the query.. uncomment your line that says: $result = mysql_query($query, $db); and change the num rows line to: else if (mysql_num_rows($result)==1) Your line that gets the column results will fail for the same reason, give it the r

RE: [PHP-DB] mysql_num_rows

2004-03-03 Thread Swan, Nicole
x27;user_id'); --Nicole --- Nicole Swan Web Programming Specialist Carroll College CCIT (406)447-4310 -Original Message- From: Craig Hoffman [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 12:50 PM To: [EMAIL PROTECTED] Subject: Spam:[PHP-DB] mysql_nu

[PHP-DB] mysql_num_rows

2004-03-03 Thread Craig Hoffman
Perhaps someone could look at this function and help me trouble shoot it? This function notifies the user of their new passwd. I keep getting an error message on this page (see below). What's strange is the script seems to be working because i am getting an email with my new password.

Re: [PHP-DB] mysql_num_rows()

2002-11-19 Thread Jason Wong
On Wednesday 20 November 2002 09:11, Tyler Whitesides wrote: > Hi, > I have been having some trouble with this, I mysql_num_rows() to find > out how many rows there are and do an insert statement in the for loop > for every row returned. So, if mysql_num_rows returns 17 then the for > loops does a

[PHP-DB] mysql_num_rows()

2002-11-19 Thread Tyler Whitesides
Hi, I have been having some trouble with this, I mysql_num_rows() to find out how many rows there are and do an insert statement in the for loop for every row returned. So, if mysql_num_rows returns 17 then the for loops does an insert statement for every instance, when the 17 turns into zero the

FW: [PHP-DB] mysql_num_rows

2002-09-19 Thread LSC Exhibits Department
-- From: 1LT John W. Holmes [SMTP:[EMAIL PROTECTED]] <mailto:[SMTP:[EMAIL PROTECTED]]> Sent: Thursday, September 19, 2002 2:56 PM To: LSC Exhibits Department; [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Subject:

Re: [PHP-DB] mysql_num_rows

2002-09-19 Thread 1LT John W. Holmes
> I'm getting a strange error message from calling this function > > It spits out > This is my query: > > SELECT dept.name, count(maintenance.deptid)/$total AS percentage FROM > maintenance > JOIN dept WHERE maintenance.deptid=dept.deptid GROUP BY dept.name > > This query runs fine in console I j

[PHP-DB] mysql_num_rows

2002-09-19 Thread LSC Exhibits Department
I'm getting a strange error message from calling this function It spits out This is my query: SELECT dept.name, count(maintenance.deptid)/$total AS percentage FROM maintenance JOIN dept WHERE maintenance.deptid=dept.deptid GROUP BY dept.name This query runs fine in console I just can't get my

[PHP-DB] mysql_num_rows

2002-04-13 Thread Luke Kearney
Hello All, I am struggling to understand why my query throws an error the code as below $link = mysql_connect ( "db.localhost.org", $user , $pass ); if ( ! $link ) die ( "Couldn't Connect to Mysql Server" ); print "Sucessfully connect to server "; $query = "select * from users " ."wh

Re: [PHP-DB] mysql_num_rows

2002-01-08 Thread bill
Drop the "$result" from the mysql_num_rows() so it reads: $num_results=mysql_num_rows(); Depending upon the PHP version, that might do the trick for you. kind regards, bill Mike Ford wrote: > > -Original Message- > > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] > > Sent: 06 January 20

Re: [PHP-DB] mysql_num_rows

2002-01-08 Thread Neil Thomson
t; Sent: Tuesday, January 08, 2002 6:07 AM Subject: RE: [PHP-DB] mysql_num_rows > > -Original Message- > > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] > > Sent: 06 January 2002 20:10 > > > > I am pretty sure that the query is correct. here is the actual quer

RE: [PHP-DB] mysql_num_rows

2002-01-08 Thread Ford, Mike [LSS]
> -Original Message- > From: matt stewart [mailto:[EMAIL PROTECTED]] > Sent: 08 January 2002 14:10 > > don't know if this makes a difference, but i've always used > WHERE bookid = > '$bookid'"; - single quote round the $bookid variable - not > sure if that's > the problem, or if it's ju

RE: [PHP-DB] mysql_num_rows

2002-01-08 Thread Ford, Mike [LSS]
> > -Original Message- > > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] > > Sent: 06 January 2002 20:10 > > > > I am pretty sure that the query is correct. here is the > actual query: > > $query="select distinct(nodeid), nodename > > from books where > > bookid=$bookid"; >

RE: [PHP-DB] mysql_num_rows

2002-01-08 Thread matt stewart
ROTECTED]] Sent: 08 January 2002 14:07 To: 'Gurhan Ozen'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] mysql_num_rows > -Original Message- > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] > Sent: 06 January 2002 20:10 > > I am pretty sure that the query is correct. here i

RE: [PHP-DB] mysql_num_rows

2002-01-08 Thread Ford, Mike [LSS]
> -Original Message- > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] > Sent: 06 January 2002 20:10 > > I am pretty sure that the query is correct. here is the actual query: > $query="select distinct(nodeid), nodename > from books where > bookid=$bookid"; > $r

RE: [PHP-DB] mysql_num_rows - update....

2002-01-06 Thread Gurhan Ozen
I think i narrowed down the problem and know what is wrong, and just solved the problem:). The problem wasn't with mysql or php it was because of my poor i should say object-oriented skill. I will tell why I had this problem so that it might be a good reference for someone else who are likely to

Re: [PHP-DB] mysql_num_rows

2002-01-06 Thread DL Neil
=dn - Original Message - From: "Gurhan Ozen" <[EMAIL PROTECTED]> To: "Richard S. Crawford" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: 06 January 2002 20:42 Subject: RE: [PHP-DB] mysql_num_rows hmm that's an idea... I stil don't get why m

RE: [PHP-DB] mysql_num_rows

2002-01-06 Thread Gurhan Ozen
urhan -Original Message- From: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 06, 2002 3:34 PM To: Gurhan Ozen; [EMAIL PROTECTED] Subject: RE: [PHP-DB] mysql_num_rows Hm, if the result you want is the number of distinct nodeid values, why not use a query like this: &q

RE: [PHP-DB] mysql_num_rows

2002-01-06 Thread Richard S. Crawford
Hm, if the result you want is the number of distinct nodeid values, why not use a query like this: "select count(distinct(nodeid)) as nodecount from books where bookid = $bookid"; Then the number of nodeid's is stored in nodecount. You might also want to look into the GROUP BY clause. That m

RE: [PHP-DB] mysql_num_rows

2002-01-06 Thread Gurhan Ozen
[mailto:[EMAIL PROTECTED]] Sent: Sunday, January 06, 2002 3:01 PM To: Gurhan Ozen; [EMAIL PROTECTED] Subject: Re: [PHP-DB] mysql_num_rows It would help if we could see the actual query. It sounds like the problem is a syntax error in the query itself. At 11:52 AM 1/6/2002, Gurhan Ozen wrote: >

Re: [PHP-DB] mysql_num_rows

2002-01-06 Thread Richard S. Crawford
It would help if we could see the actual query. It sounds like the problem is a syntax error in the query itself. At 11:52 AM 1/6/2002, Gurhan Ozen wrote: > Hi everyone, > I have a problem with mysql connectivety which is making me nuts. If the >query is "select blah, blah from table" (i.e.

[PHP-DB] mysql_num_rows

2002-01-06 Thread Gurhan Ozen
Hi everyone, I have a problem with mysql connectivety which is making me nuts. If the query is "select blah, blah from table" (i.e. without where clause) mysql_num_rows returns the right number, but when i put in a query with where clause, although there are rows returned, PHP is giving: "Warni