if description does not contain the following words


Posted on 16th Feb 2014 07:03 pm by admin

Hello everyone,

I am parsing a MS Excel (.xls) file and adding it's content to a mySQL database, so far to good, but what I want to do is if the column titled description does not contain these words "seedlings" or "discount" then add it to the database but if it does skip it and keep looping.

Here is my code that I am trying to get working:if((!empty($description))or($available >0)and(!preg_match("/seedlings/i", $description))):
mysql_query("INSERT INTO `availability` VALUES ('','$description','$available','$price')");
endif;

I may not be using the right function for this "preg_match"?

No comments posted yet

Your Answer:

Login to answer
70 Like 27 Dislike
Previous forums Next forums
Other forums

this code is not working????
it says this error.. Warning: Division by zero in ..

the variables are correct, so why is th

chat
hello i'm amir i need a chat source code in asp.net 2.0 without Ajax. anybody can help me?

Uploading Filetypes and placing them in seperate folders.
Hello,

first post , and asking for help im afraid. Very new to PHP, was making good progress

javascript in php code causes page to display white
Hi All,

Odd one this, I've got the following code (below) which is a simple log in form. The

Switch letters in message (basic cryptology)...
I am trying to switch letters around in a message for an application on my site (see here). The prob

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

using explode() to fill in checkboxes
Hi

I have a field stored in a table that contains regions in the UK separated by commas. Ther

Calling variables
I want to call this to my website but it doesn't display what I want it to,

Code: <h5&

problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mi

help with calculations on a flat text file
hello,
I have this code below that is attached to a flat file like this:
Email:LastName:FirstN

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