Retrieving values from database
Moderator: General Moderators
-
Manoj Kumar
- Forum Newbie
- Posts: 8
- Joined: Thu Jan 12, 2012 6:00 am
Retrieving values from database
Hi all... I'm trying to create one web portal... For that i've a database which contains a field called comp_name and am trying to retrieve the values stored in that field in a text box using ajax autocomplete. I've a value which is repeated twice in the comp_name field and i would like to display that value only once to the user. How can i do this ?? help me out..
Re: Retrieving values from database
Add a limit clause to your query?
-
Manoj Kumar
- Forum Newbie
- Posts: 8
- Joined: Thu Jan 12, 2012 6:00 am
Re: Retrieving values from database
I'm new to php and mysql concept. Here is my query
SELECT * FROM customer_tb WHERE comp_name LIKE '$str%' and status = '1'
What changes do i need to do ?
SELECT * FROM customer_tb WHERE comp_name LIKE '$str%' and status = '1'
What changes do i need to do ?
-
Manoj Kumar
- Forum Newbie
- Posts: 8
- Joined: Thu Jan 12, 2012 6:00 am
Re: Retrieving values from database
It's working . Thanks for the help .
Re: Retrieving values from database
If you only need comp_name, replace SELECT * with SELECT comp_name