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

Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.

Email Form Syntax Issue
I need the TO: in email to display To: CEO instead of To: abc@mail.com

How to alter the scri

split values
I have values that are returned to me in this format:

name=>test,age=>49

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

SAP Logon Failed
I tried to login to SAP through MMC.

When i click start and give password.

it

Install page
How do I make it so when a user submits information on the Install page, it'll right it into the cor

php + mysql count consecutive data
I have a database of values and I want to work out how to display them if the values match a consecu

Simple image grab script.
I was wondering if it was possible and if anyone knew how to make a simple php script that looks at

Had a simple form script that suddenly stopped working
It was made about a year ago and had been working fine. Last time it was known to work for sure was

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