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

how to insert value
I am having file bookissueadd.php..... in which i am having tag

<td height="21&q

Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it lo

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently

PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

Call to undefined function mysql_fetch_accoc()
New to php/mysql coding. What's wrong with this sequence, or am I
just not seeing to obvious?

show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i

how to export excel file in same server
My first post - php newbie, so appreciate your support.

I'm currently using headers to save w

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