Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 8th, 2005, 07:14 AM
Friend of Wrox
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default 1 More question!! (me think!)

I have almost finish my search page!! which is good!! well for me anyway ;)

Got 1 more query about MySQL (I think)
How do I search for keywords?
I was thinking about:
$query = "SELECT * FROM Table_Article WHERE
Article_Title CONTAIN SearchText OR Article_Main CONTAIN SearchText ";

Which I haven't try to run because I'm pretty sure there's no such CONTAIN (SQL?) comand..

Anyone with the correct command for me??
Thks :)
Old March 8th, 2005, 07:22 AM
Friend of Wrox
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post

Hi Mantis,

Try this...
$query = "SELECT * FROM Table_Article WHERE 
Article_Title LIKE '%SearchText%' OR Article_Main LIKE '%SearchText%';";
(the % are wildcards)



Old March 8th, 2005, 08:26 AM
Friend of Wrox
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts

This is so cool :D
Thks :) :)

Similar Threads
Thread Thread Starter Forum Replies Last Post
question maheshraju ASP.NET 2.0 Basics 3 March 13th, 2008 08:54 AM
Question Ashwini Classic ASP Databases 3 January 10th, 2006 07:20 AM
Question? Calibus Classic ASP Databases 8 August 6th, 2004 08:25 AM
a question gorji C++ Programming 2 August 11th, 2003 07:41 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.