Jump to content

[SOLVED] searching for multiple keywords


anthony-needs-you

Recommended Posts

Hi i have two bits of code. On their own they work fine.

 

How would i put them together?

 

$result = mysql_query("SELECT departureDate, expireDate, airport, destination, resort, hotel, duration, board, price, description, customerRef, mystiqueRef, stars FROM holiday WHERE destination LIKE '%$where%'");[code]

$result = mysql_query("SELECT departureDate, expireDate, airport, destination, resort, hotel, duration, board, price, description, customerRef, mystiqueRef, stars FROM holiday WHERE duration LIKE '%$stay%'");[/code]

Link to comment
https://forums.phpfreaks.com/topic/139579-solved-searching-for-multiple-keywords/
Share on other sites

Have you tried appending another conditional?  I think that should work.

 

$result = mysql_query("SELECT departureDate, expireDate, airport, destination, resort, hotel, duration, board, price, description, customerRef, mystiqueRef, stars FROM holiday WHERE destination LIKE '%$where%' AND duration LIKE '%$stay%'");

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.