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")
{
Did you know?Explore Trending and Topic pages for more stories like this.
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

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

records between 2 dates
Hello all,

I have a date tracked table which contains effective_start_date and effective

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

Using Windows message as a Handle
Hi,

I am writing one of my first multithreaded programs.

In one of the thread,

Connection Timeout
I'm using xmii 12.0

I'm calling a transaction as a web service from a windows application

How to implement HTTP connection timeout
Hi All,I would like to implement an HTTP connection timeout.

I am working on a application wh

Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does

generating all possible random letters
hi'

how can i randomize the letters a,b,c,d,e all possible ways, and i want to print the res

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