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

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

Mastering Regular Expressions, Third Edition, is available.
The Third Edition of Mastering Regular Expressions is available.

QuoteThis third edition is 5

Batch Session SM35 stuck in status 'in Background
Hi Experts,

I am facing a problem with Batch Input session SM35.

The batch se

Help with lottery style system?
I'm working on a currency system for forums and it is going to have a type of lottery system built i

preg_replace question
Hello!!

I hope someone can help me with preg_replace.

I load two tables from an extern

Apple's revamped lineup arrives

I'm personally curious about the magic mouse.. a multi-touch concept sounds like it could be nea

ScriptResource.axd gives an error on fresh install of ASP.NET Ajax 1.0
Hello,I have a fresh install of Microsoft ASP.NET Ajax 1.0. When I create an Ajax enabled website in

Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that

remove innitial

and

tags
i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p>

Simple Variable Question
Hi everyone.... again,

I am really getting into php still. Learning more every day. I love it

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