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

RTF fomatting to email content
Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mai

very easy question about SQL info
Hello,
I think that I have a very easy question.
I know how to create a form using php SQL and

Better Method of a Member Cloud
I assume most people know how tag clouds work, where the tags most used are bigger and the least use

defining website tags
Hi,

What would be the best way to define tags for my site, such as website title, url etc.

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

Header redirect
Hello ive got a problem ive got form with its action set to itself.
Code: <form id="f

help me, how to find text on an external html site using PHP
Would anyone know how to search an external html file for a work or phrase ?

I was thinking s

Converting numbers to months
The porgram works -just need the last function(month_convert_ to convert numbers to months -thanks.

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