Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi idk how to search somevalue in database

Example
I have this valum in name colum
C#
test01
test02
test03
atest
atest2
btest3
btest1


Then in use sql command
Example
SELECT * From DataShop WHERE name LIKE 'test'"

Data don't show anything

i want to search
C#
test 

data will show

C#
test01
test02
test03


Please help me :)
Posted
Comments
[no name] 11-Sep-13 15:55pm    
http://w3schools.com/sql/sql_like.asp
CPallini 11-Sep-13 15:58pm    
(virtual)5.

Your sql statement should read like this:

Select * From DataShop WHERE name like '%test%'
 
Share this answer
 
SQL
SELECT * From DataShop WHERE name LIKE 'test%'
 
Share this answer
 
Dear Friend,


Please give the following select command:

SELECT * From DataShop WHERE name LIKE '%test%";


This SQL command will select rows with 'test' anywhere in the name column.

Please read the following article and rate it.

Chat Application in PHP
 
Share this answer
 
Comments
ridoy 11-Sep-13 16:59pm    
solution is quite good,but rating an article isn't related to answer a question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900