$query = mysql_query(SELECT * FROM test WHERE SUBSTRING(date,0,4)="1392") //for example 1392
echo query['name'];
i want to get 4 first character and check its equal with 1392 or not .
but its return 1054 my column name type is varchar and i have no idea about this.
MySQL count char from 1, not from 0 as php.
try
or if you want the year
http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_substring
EDIT test exemple