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

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are

Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i

Strange php code found on my website
I got hacked and the following code was placed within my files:

Code: [Select]<?
/*

download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a dir

Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out wh

Problems generating word documents on server side for security reasons
I have a problem with word documentation generation when generating a word document (docx) with PHP.

Tracking Unique Clicks
Hi guys and gals,

Basically I have a database which tracks clicks on my outbound links, I do

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Displaying image from database
Hi,

I've got a site where that's got a database behind it. Currently it has loads of items in

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