473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

search key help

Hi, every one..
I need a simple help from you guys. Actually, i have simple query to search in my database. The scripts is some like this
[PHP] $sql = "SELECT * FROM courier_table WHERE $fieldname = '".$key."'";[/PHP]
Here $key is a variable where i stored the search value. Actully, i want to used like key word in place of = (egual to sign) in sql query.
Please do help me.
Nov 8 '07 #1
4 987
MarkoKlacar
296 Expert 100+
Hi, every one..
I need a simple help from you guys. Actually, i have simple query to search in my database. The scripts is some like this
[PHP] $sql = "SELECT * FROM courier_table WHERE $fieldname = '".$key."'";[/PHP]
Here $key is a variable where i stored the search value. Actully, i want to used like key word in place of = (egual to sign) in sql query.
Please do help me.
Hi Robin,

I'm not quite sure I understood you question.
Does the query work today?

Cheers
Nov 8 '07 #2
dafodil
392 256MB
You can use this:
[php]
$sql = "SELECT * FROM courier_table WHERE $fieldname like '$key'";
[/php]


or if you have something like a textbox and you want to display every thing that the user type starting with that text.
you can do this:

[php]
$sql = "SELECT * FROM courier_table WHERE $fieldname like '$key%'";
[/php]
Nov 8 '07 #3
Hi, its working .. thanks a lot ..

You can use this:
[php]
$sql = "SELECT * FROM courier_table WHERE $fieldname like '$key'";
[/php]


or if you have something like a textbox and you want to display every thing that the user type starting with that text.
you can do this:

[php]
$sql = "SELECT * FROM courier_table WHERE $fieldname like '$key%'";
[/php]
Nov 8 '07 #4
dafodil
392 256MB
You're welcome.
:)

Post again anytime.
Nov 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: R. Rajesh Jeba Anbiah | last post by:
Q: Is PHP search engine friendly? Q: Will search engine spiders crawl my PHP pages? A: Spiders should crawl anything provided they're accessible. Since, nowadays most of the websites are been...
2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
14
by: vic | last post by:
My manager wants me to develop a search program, that would work like they have it at edorado.com. She made up her requirements after having compared how search works at different websites, like...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
2
by: Scott | last post by:
I'm trying to use the HTMLHelp API calls in a VB.NET program because I want a little more functionality than is offered by the Help class in .NET. Everything works fine except for displaying the...
3
by: Sheau Wei | last post by:
This is the search engine code that i create, but it was error and didnt come out the result. Cn u help me to check what wrong with my code? Thanks <Table cellspacing=1 cellPadding=1...
3
by: alaa123 | last post by:
hi plz do not ignore me I really neeed ur help I am working on a progarmme to implement First Search and Breadth Search I did the first search algorithm but I need help with implementing the...
0
by: xmanofsteel69 | last post by:
I'm trying to create a search function for my site and I can't ever seem to figure it out. If anybody could help, that would be awesome, because everything I try, I keep getting errors... Here's...
3
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I have a VB app, and I have been working at it for a while, and I am now at the stage where I want to create a search function. Now don't be scared! It is in the .Net compact framework,...
0
by: kang jia | last post by:
hi currently i am doing this search function for car booking website. it can search through either car seats or CarModel. it seems it able to do search function, however i small problem occurs to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.