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

reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

Do not allow posting of whitespace
Currently the script below works if the user does not type a name/message, but if i create a whitesp

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill t

PHP5 - Verifying a secure mail is secure
I need to send an e-mail from a form to a external department and because it contains personal custo

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

iterating through an array and escape each value independently.
I have a set up where the variable being escaped is an array and it needs to be iterated and escaped

How can I Compare two xml documents?
Hi all,

I am doing a POC for my project and I am using XE database 10g version.

Cache PHP Objects/Classes?
Does anyone have ideas about caching PHP objects using something like: http://memcached.org/

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