Jump to content

Text Area CSV Search


Matl

Recommended Posts

Hello,

I have a very basic search form that I would like to be able to pass to my PHP processing script so that a single column in the Mysql table can be matched against all comma separate values that the user enters into the form text area field.  I can't seem to get the exact solution.

 

Form text area is named: center

 

$centersearch=$_POST["center"];

 

SELECT * FROM cities WHERE center LIKE '%$centersearch%'

Would I need to do a pregreplace to eliminate the commas before using them in my query or enter them into an array of some sort?

 

Thanks in advance!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.