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

How to assign a textbox value to PHP variable??
Hi ! Can any one help me out as quickly as possible. As I m new to PHP.
Plz tell me how to assign

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

Target costs on Process orders not calculating
Hi All,

We have released standard costs for all the materials. We have also done Goods r

that old Malformed Headers problem again!!!!! HELP!!!!!!
I've read the http://www.phpfreaks.com/forums/index.php/topic,37442.0.html

I don't think my c

Renaming array keys
The issue: renaming array keys inside a foreach loop.

I'm trying to build a pie chart image w

getting rid of quotes in strings
sick of trying to deal with them in multiple ways (entering in and taking from database, echoing, ec

To add a field on the screen XK02.
Hi All,

How to add an additional field in the vendor change control screen XK02.
The

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

Need PHP help... have all the elements... just need help putting them together :
Hey Guys,

I was wondering if someone could help me. I am doing a website for a client which

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