How to check database with php variables like this ?
I have
$check = "1234567890";
This is table : check_data
_________ ______________________________________________________________
| id | key_pass |
|_________|______________________________________________________________|
|____1____|_______________1234567890abcdefghij___________________________|
|____2____|_______________6545ryu76543werfdt54___________________________|
|____3____|_______________345jfuryt75yrhtufkgo___________________________|
|____4____|_______________weoiufoiweu9ew8ew8w8___________________________|
|____5____|_______________oi34ioruiofuefiusdfo___________________________|
|____6____|_______________iuyiuysdifuysfiuyfds___________________________|
i want to check like this.
$sql = "SELECT * FROM check_data WHERE key_pass(first char to ten char) = '$check'";
$query = mysql_query($sql);
$result = mysql_fetch_array($query);
if($result)
{echo "found";}
else
{echo "not found";}
How can i do that ?