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

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

update the selected existing records of database
Hi frndz,
I am new to php and get stuck....

Edit.php > Update.php > Updatea

ob_ dynamic content
i was wondering about the potential to use ob to create a <div then remove it when the page

am I using this for loop correctly
Dear buddies!

Right now I am generating a report with some details for all the dealers.

Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w

send message to the java application
Oracle 10g with Windows platform.

I have a java application that periodically pings the d

Which PHP-Editor do you think is the best?
Hi everyone,
Myself Brian Anderson. For the last 2 years i have been working a

selectbox+database connection retrive problem
Code: [Select]
<tr>
<th align="left" scope="c

close site for maintenance
i get a tutorial, saying the following code can put our site offline, and only the developer can vie

Calling a Procedure with IN & OUT Parameters
Hello,

I usually call my procedures using the following way

declare variable e

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