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

delete comma
HI,

How to delete "," at the end of the string.
Code: $match = 2009/02/03/a2corr

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

function not returning the correct value
I have a program that needs to return a value from a function. I have an output statement inside the

WELCOME SCREEN
first of all let me tell you what does my script do,

it´s a very simple query to show a e

trim function issues
Hi guys, total noob here...

So I've been tinkering around with a html and am using php to em

Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

smart reading from a text file
Hello there fellow coders, i was wondering if one of you wouldnt mind helping me with this problem i

Storing/displaying image urls in a database?
Hi
Basically I have the following scenario:
User chooses picture from list. Picture info is ad

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

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