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

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

MVC - Code review
I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to impl

scandir clients directory
hi,
how can i scandir the clients directory? i need a script that when i click a button it will u

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

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

Saas with SAP R/3
hi experts,

Is SaaS offer available in SAP? for SAP R/3? from where i can get the info a

Echo multiple lines of html code
Hi guys,

I would like to know if there is a way to echo multiple lines of html codes.

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

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

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