Use case: Created a record
Spot, Code, Language, Count
...later found out language entered was wrong. Tried to change the language using UPDATE query. Concatenated string still show same. Updated language string not changed in the concatenated string.
Created record using this MySql query
$sql = "INSERT INTO library (spot,code,language,count,litcode) values(?,?,?,?,CONCAT(language,'-',code))";
Tried to UPDATE language using this MySql query
Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "UPDATE literatures set spot = ?, code = ?,language = ?, count =?, litcode = CONCAT(language,'-',code) WHERE id = ?";
$q = $pdo->prepare($sql);
$q->execute(array($spot,$code,$language,$count,$litcode,$id));
Database::disconnect();
Finally language was updated but its not updating in the concatenated string.
Any errors in the UPDATE query?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…