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

Running External Scripts
I am very new to PHP and am not even sure what I'm asking is possible. I have just installed mediaW

Change of partner analyse in sales orders
Hello,

I changed the partner analyse for sales orders and added a new mandatory partnerro

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() {

Having problemswith multithreading and prime numbers
I have an assignment when I'm suppose to do the following:

Write a multithreaded Java, Pt

Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.
The

Call Screen statement Error
Dear Experts,

is there any setting that needs to be done before creating any dialog progr

Pre-Fill out a PHP form...??
This is for work actually (geek squad). We have to fill out this online php form at work over and ov

Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

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