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

MSSQL/PHP
I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which

Inter Company -- Resources Related Billing (Services Industry)
Hello,

My company has a scenario where:
Company A bills Company C for INTER (cross

Object Interfaces
EDIT: Never mind, I just updated to php 5.

Hey all,

I'm currently experimenting with p

problem in pagination when processing with selectbox form
Hi,

I have a search form, with select boxes, if am selecting the value from the form, it work

DateObject and Nulls
Hi all,

I have an array mapped to a value object. One of the items in the array is a PHP Date

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

How to search for several parameters from objects in a database?
I have a database with lots of information about objects.
Now I would like to search for 4 or 5 p

Setting/Modify Headers using mail() function
I have a question about setting email headers when using mail() in a php script.

When I send

RSS feed - FeedList for WordPress
Hi,

I'm trying to alter the FeedList plugin for WordPress so that I can click on the title of

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

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