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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

Need help/w Page: 1,2,3,4 function!
So I have this code im working on where it's ment to display seperate pages having 20 logs each
I

extract content from a website
i have written a code that will grab the content from the index page..
i would like to know how c

Page not Loading After Test
Hey All

It seemed that an inlcude statement wasn't working for some reason, so I tried a more

Business Health Check
Hello

I need to create an online business health check for a client it will be multiple choi

PHP XML extraction text
I would like to extract an xml text and have that text directly echo(print) out on my web page. Her

Help With editting and deleting form
So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.png
This table

Secure pages Sessions vs. Cookies & session_destroy() help
Im new here and new to PHP, I hope you can help me with some questions.

Im writing my web ap

mysqli_fetch_assoc returns multiple arrays, how to return a single array
Hello, I am using mysqli_fetch_assoc which is returning multiple rows, so it looks like:

Code

Undefined variables
hi
----------------------------------------------------------------------------------------------

Functions Not Loading Into Div
I had some help doing some of this but what I'm trying to do is get my functions to retrieve its val

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