hphilg Posted March 5, 2011 Share Posted March 5, 2011 Bonjour,je suis entrain de tester un script me permettant de faire un update sur la table ps_manufacturer_lang mais j'ai un souci : $connection=mysql_connect($host,$login,$pass); mysql_select_db($database) or die ("pas de connection"); mysql_query("SET NAMES 'utf8'"); $req="select pml.id_manufacturer, name, meta_title FROM ps_manufacturer_lang pml INNER JOIN ps_manufacturer pm ON pm.id_manufacturer = pml.id_manufacturer"; $exe=mysql_query($req,$connection); $queryTable = array(); while($result=mysql_fetch_array($exe)or die(mysql_error())) { $id=$result['id_manufacturer']; $name=$result['name']; $req2="update ps_manufacturer_lang pml set meta_title = '.$name.' WHERE pml.id_manufacturer = $id"; je n'arrive pas avoir la bonne syntaxe pour cela : set meta_title = '.$name.' quand j'enleve les cotes sur la variable $name, la requete SQL interprete cette valeur comme le nom d'une colonne.Moi je voudrais que la requete interprete cela comme un valeur.QUelqu'un a une idée sur la bonne syntaxe (je ne gere pas bien les cotes et double cotes je pense)Merci d'avance ! Link to comment Share on other sites More sharing options...
Vincent Decaux Posted March 5, 2011 Share Posted March 5, 2011 A priori : $req2 = "UPDATE ps_manufacturer_lang pml SET meta_title = '".$name."' WHERE pml.id_manufacturer = $id"; Link to comment Share on other sites More sharing options...
hphilg Posted March 6, 2011 Author Share Posted March 6, 2011 Merci Vincent, ca passe mieux comme ca 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