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

xApp Analytics in BI 7.0
Dear all,

I am trying to implement xApp Analytics in BI 7.0. After I installed the analyt

Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/

values in array being escaped
I would like to submit some values - back to the same form for checking before processing...

highlighting search terms
well, I started this in the regular PHP section, but it no longer fits there. Suffice it to say, I'm

Will this protect from mysql injection?
I do not want anything like DROP TABLE to work or any type of coding..

Heres my code.. is it

parameter passing issue on function
Well I thought I had created a pretty slick web page, using ?page and $_GET to load pages which wher

mysql_query returning boolean instead of mysql ressource
Hi,

I seem to have a weird issue with the php command mysql_query. I pass 2 arguments the que

php require help needed
Ok i tried to use the search funtion but the word require is everywhere.

i'm really new to cr

How would I convert this into code using an if statement?
ES equals exam score m equals $mean s equals $total. I already coded my mean and total so I'm not g

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

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