cliftonbazaar Posted April 24, 2009 Share Posted April 24, 2009 $sql = "UPDATE players SET '$adventure['image']'='{$player[$adventure['image']]}' WHERE characterName='{$player['characterName']}'"; After fiddling with the code I have worked out that '$adventure['image']' is the problem. What is the correct syntax? (and yes, the variable is the correct column name) Link to comment https://forums.phpfreaks.com/topic/155456-solved-update-table/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 24, 2009 Share Posted April 24, 2009 Single-quotes around a value makes it a sql string, not an sql identifier. Remove the single-quotes that are around '$adventure['image']' You also need to put $adventure['image'] inside of {}, like the other php array variables are in that php string. Link to comment https://forums.phpfreaks.com/topic/155456-solved-update-table/#findComment-818027 Share on other sites More sharing options...
cliftonbazaar Posted April 24, 2009 Author Share Posted April 24, 2009 Thanks for that; still learning Link to comment https://forums.phpfreaks.com/topic/155456-solved-update-table/#findComment-818035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.