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 get the bind variables list.
I've the following problem : I've some SQL queries stored in my DB as VARCHAR2 values.
I need t

Cron Job and Output
I have php codes running under a cron job.
But everytime i output (echo) , it comes out as comple

redirect standard error and assert (how to?)
How do you redirect standard error and assert?

---

(Why? I am creating an web app and

Basic Forum Tutorial
Hi, I'm new to PHP. I want to build a basic forum for my site using PHP and MySQL. I've searched t

There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

The repetition structure: the while statement not working
New programming student, have assignment as follows:
A restaurant has 4 lunch combos for custom

FlashVar function how to insert variables
Hi guys. Im new in this forum and also new in php programming. Can you help me about this code?
<

This is driving me nuts!
This insert query looks to be alright, however I get this error:

QuoteYou have an error in yo

Does design fit in FPGA ?
Hi all,

I've made a large HCC-Design. Because of the program-size the compile process with th

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