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

Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different pl

date("now") prints out wrong date ?
Hi Guys
Anyone know why and how I can fix it ?

PHP submit form script causing blank page
Im trying to submit a form using this script, however nothing shows up on the page, does anyone know

Checking if a process is running (problems including psapi.dll i think...)
Ok, so all I'm trying to do is check if a program is running...

I've found out that I nee

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

Lack of simpleXML Documentation
What is up with this.

Look at: http://www.php.net/manual/en/function.simplexml-load-file.php<

Accessing Infotype data in dialog program
Hi All
In Dialog programs attributes I didn't see any logical database field. How can I access

Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Mes

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

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