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

Most basic form question ever?
Hello,

I want to use this snippet to make sure the fields in a form are ok before processing

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

Calander Basic Spript help
hi, just starting out with PHP and have the following script:

<?php
//This gets t

Character Set Setup
Whats the best character set to use if you want every character to work, and also how do you make yo

Creating a function
Basically i wanna put all this code in a seperate file

Code: <?php

passthru() help
Hi everyone,
I'm new to the forum and to PHP. I have some pretty good experience writing shell sc

Help? Need help on project with templates involving mysql and php.
I'm having a hard time explaining what I want but basically here is what I have in place:

-Da

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading fi

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