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")
{
Did you know?Explore Trending and Topic pages for more stories like this.
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

Only add new information from XML to MySQL
What I am doing, is taking a xml file, and adding the values to a database. However, what I want to

Login Script Issues
I am using a script I got from http://phpsense.com/php/php-login-script.html in order to allow peopl

delete comma
HI,

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

SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is sign

 formating when pulling data from a mysql database 
Ok so Im not to sure if this is the right thread to post in but here is my catch 22 issue.

I

mySQL and PHP search
Hello,
I am trying to code a project and ran into a brick wall with one of my pages. I am pretty

How to show next and prev records
Hi all,

Sorry if this is simple, i'm very new to php, well, any programming language actually

button help
i originally had this but realised it is much easier to have a button.

Code: <?php

Combining Two Queries
I have two scripts that each work fine by themselves. One is a search script with a variable that de

Read from a text file after a specific word
Hi all.

I have a text file that looks like the one below.
I know how to open the text fi

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