Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need help with php mysql.......
Old 02-05-2010, 05:45 AM Need help with php mysql.......
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi.

I want to generate a script where I can get related categories names in left/right panel........................as per the keyword entered by user.....

Can anyone help me on this as what the query should be............

I am using this..............

PHP Code:
select from tblcat where category '".$_REQUEST['get_searchword']."' 
But its showing on one keyword.........not all related with that.............

eg. if a user search for "Car Hire"

so that right/left panel shold show all the keywords having name Car + Hire in my data base.

Thanks in advance!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-05-2010, 06:21 AM Re: Need help with php mysql.......
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
At a guess because I do not know how the data is stored to be precise about how to search it.

use wildcards and the LIKE operator

By the sound of it though, your table schema has been badly designed from the outset.

AND

NEVER EVER use direct user input values in a query. ALWAY ALWAYS sanitise them first to reduce the risk from SQL injection attacks.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-05-2010, 07:01 AM Re: Need help with php mysql.......
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Thanks for your reply chrishirst,

You are right................I am a newbie..............that's why making these silly mistakes.............and silly question......................but still I'd like to know how to sanitise user input values...........if you don't mind.......

BTW..............Thanks for your consideration......
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 02-05-2010, 07:19 AM Re: Need help with php mysql.......
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.webmaster-talk.com/php-fo...njections.html
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-05-2010, 07:20 AM Re: Need help with php mysql.......
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Read this thread, it will explain how to filter the parameters and prevent sql injection:
http://www.webmaster-talk.com/php-fo...injection.html

Edit: Baah, Chris beats me (again) on the finish line...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Need help with php mysql.......
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23779 seconds with 12 queries