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

Loops and Classes
I am making a template system and everything seems to be going well up until I have to loop in a var

Need Help with a query
Hello,
For some reason I am just not getting the right answer when I do this query and not quite

Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav

Thread in PHP
Thread in PHP
Some basic use and basic code for thread in php
This is my question?

Validation
Hello

I know this is a really vag question.

I need to have a input field on a form th

ASP.NET Validation Event Cycle
Hi,
I have asp button as follow:

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

Multidimensional $_POST
Hello

How to get a single array from array of array (2 - dimension).
For example I have a

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

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