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

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate w

Lack of simpleXML Documentation
What is up with this.

Look at: http://www.php.net/manual/en/function.simplexml-load-file.php<

How to use php and sql to check if values match the ones in a table (for logins)
How would I code it that the script takes two variables that are passed to it (UserID and PIN), and

Strip Slashes Help
I've got a script that i've downloaded of the net to edit multiple fields from my sql database, and

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

ALV grid with 2 headers
Hi Gurus,

I need to display ALV GRID as below.

Header1

php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have tho

Apple's revamped lineup arrives

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

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