rechercher dans une bdd avec les premieres lettres

WRInaute discret
d'une valeur d'un champs.
voilà parmis une table, j'aimerais faire une requete qui liste toute mes images qui commencent par un mot!
exemple: football!
ainsi j'aimerais lister toutes mes images qui se nommeraient:
football1.jpg, footballparis.jpg, footballkonquror.gif etc ....

en faisant ainsi je devrais y arriver non ?
Code:
$retour= mysql_query("SELECT * FROM images where image LIKE football ") or die (mysql_error());

$rep = mysql_fetch_array($retour);

print_r($rep);

mais ça marche pas
 
WRInaute passionné
$retour= mysql_query("SELECT * FROM images where image LIKE 'football%' ") or die (mysql_error());

Avec un % ça marche mieux :)
 
WRInaute discret
ça amrche pas !!

j'ai ce message :
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'imagefootball WHERE image LIKE 'football%'' at line 1
 
Discussions similaires
Haut