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

Modal Popup Help
Hi guys, I have a modal popup with an iframe. How can i send data from a label or textbox to the ifr

Reditecting pages based on logic
Newbie here, apologies in advance!

I am trying to use the header function to forward one of a

FTP issues
Hi all,


I am currently facing some serious problems with a script and really need some ad

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

Pass sql into pl/sql and create RMAN duplicate script.
Hi,

I'm new to pl/sql and I'm trying to write a script that will generate some RMAN comma

Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re

Simultaneous select/update/insert
Hi

How would I need to go about when 2 users update a single row simultaneous? And how would

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

utf8_general_ci error ??
I have all kinds of data to be inserted in database table

//I am getting this error

Yo

form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for

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