[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

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

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 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 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-