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

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

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

contact form - output to page and email
I have the following in my controller:

$message['name'] = htmlentities(strip_tags(trim($_POST

Read from forum
Haven't written anything forever and I would like to get back.
What I'm trying to do is getting t

Filling gaps in dates
So i'm doing a query for sales data and my return array looks like this

('date' => '20

php mysql script to find record
Hi,

Currently I have a simple table with 4 columns. A, B, C, D

If I want to find all

Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with

IDOC error
Hi, When i send IDOC from ECC system to MII there is no problem ECC side, i says message sent succe

How to display objects in a row
I have 7 codes that i want to display in a row one next to another.
The first is {$ads->ad

SOAP Issue
Hi,

I am facing some understanding problem with SOAP basic.kindly recommend some SOAP expert.

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