joouul Posted March 6, 2015 Share Posted March 6, 2015 Bonjour, je fais un SELECT sur ma DB comme ceci $sql = "SELECT * FROM xxx INNER JOIN xxx ON xxx = xxx WHERE xxx = x AND xxx = x"; $variable = Db::getInstance()->getValue($sql); et quand je fais un var_dump($variable), il ne me retourne qu'un seul résultat alors qu'il devrait m'en retourner plus ... Une solution ? Merci d'avances Link to comment Share on other sites More sharing options...
fred-vinapresta Posted March 6, 2015 Share Posted March 6, 2015 Bonjour, il faut utiliser ExecuteS à la place de getValue 1 Link to comment Share on other sites More sharing options...
joouul Posted March 6, 2015 Author Share Posted March 6, 2015 PARFAIT =D un grand merci =D Link to comment Share on other sites More sharing options...
J. Danse Posted March 6, 2015 Share Posted March 6, 2015 Bonjour, getValue() ne vous retournera en effet qu'une seule et unique valeur. getRow() vous retournera un array() correspondant aux champs de votre table. ExecuteS() vous retournera un array() multi-dimensions, comportant un ensemble d'array équivalent à getRow(), en gros. Link to comment Share on other sites More sharing options...
coeos.pro Posted March 6, 2015 Share Posted March 6, 2015 Un peu de lecture : https://www.prestashop.com/blog/fr/les-bonnes-pratiques-de-la-classe-db-sur-prestashop-1-5/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now