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

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

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


print_r($array);

Prints:
Code: [Select]Array

How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse

MySQL noob question
hi guys

I have a simple mysql table set up, along the lines of

Col 1 - Col 2 - Date_l

pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the n

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then

SQL Injection
In my attempts to protect my database from mySQL injection I have created another problem for myself

for loop without same $i digits?
Hi,

Can some guru please advise how can I accomplish this with a simple for loop ?

I

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