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

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

Security Exception on pages using AJAX
I am getting the exception: attempted to perform an operation not allowed by the security policy on

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

Functions Not Loading Into Div
I had some help doing some of this but what I'm trying to do is get my functions to retrieve its val

Table trouble
i have been reading the forum for a few weeks and decided to join. i like the format and the advice

Contents of variable not echoing
Hey guys, hopefully this is an easy one...

In this line, the variables are not echoing out. T

I apologise! It's a newbie to PHP feedback form problem!
Hi,

I am a total newbie to PHP. I am also a unemployed and need to get a job. So after 100% r

Linux socket programming
Where can I find a good introduction to socket programming?

Help a newbee save my job !
Hey guys i am dying here i am new to php and would like for someone to help me with this problem

Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since co

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