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

preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the strin

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

multipart emiail forms
Hi All,

I am new to the boards and I've been working on a form (which is rather massive, imo

displaying unknown amount of results
I am reading a directory and getting a list of folders in the directory, I want to display the folde

UPLOAD IMAGES NOT WORKING!
Hi there i have a upload script in which it uploads the picture to a folder than creates two thumbna

Linked Keywords
I am trying to get a script that makes my predefined keyword converted to links and / or converted t

How to separate records and ORDER BY
Let say i have 100 records and displayed in one page, then i want to get the records from 50-100 and

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

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