PHP using IF to display error


Posted on 16th Feb 2014 07:03 pm by admin

i have a MySQL query and i want to display 1 thing only if the number of affected rows is >=1 and if not then display the error, here is what i have so far and nothing is being displayed ...

Code: if (mysql_num_rows() >= "1")
{
echo "Update OK!<br />";
}
else
{
die("Update failed: " . mysql_error());
}

No comments posted yet

Your Answer:

Login to answer
331 Like 54 Dislike
Previous forums Next forums
Other forums

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h

a dificult string search
Hi I don't know a way around this. I want the user to input a password, but to make it a bit complca

asp authentication problem
Hello all, I want to use the asp authentication (from asp.net configuration) in my web site. there

I would like "for" to wait 5 sec
I would like my 'for' loop to wait 5 sec before second iteration.


for ($i=0; $i<10

Implementing Single Sign-On using SAML 1.1, x.509, LDAP in C#.net
Hi, I got a requirement from the client i.e implementing single sing on using SAML 1.1( LDAP &

fire away
i launched about 4 months ago as a lagit co. i have 2 paying clients, 1probono, 1 side progect, and

Change Web page language
i doing this thing first time but i dont find any suitable solution for it. On the demand of user. I

On page view, minus credit
Hello all, please, I need a little help with this script. I am charging one credit (credits can be p

Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash