iRoot121 Posted August 2, 2013 Author Share Posted August 2, 2013 Can you post the exact values of your variables in the query? It's not much . $title = Test2; $korting = 0; $volg = 0; $product = 1; $visible = 1; $metadescription = Test2; $url = test2; $content = Test2; $id = 1708; I've also tried this: $title = Test3; $id = 1708; And with both he's updating now. So I'm going to try it with a select statement. Quote Link to comment https://forums.phpfreaks.com/topic/280756-sql-unknown-column-title-in-field-list/page/2/#findComment-1443236 Share on other sites More sharing options...
jazzman1 Posted August 2, 2013 Share Posted August 2, 2013 For sure, you sould have to optimize your database and tables. Watch these 9 vidoes. To escape the character strings, you can try to run this update query instead yours: $query = sprintf("UPDATE `pagina` SET `title` = '%s', `korting`='%s', `volg`='%s', `product` = '%s',`product_id`=%u, `visible` = '%s', `metadescription` = '%s', `url` = '%s', `content` = '%s', `headerpicture`='%s',`picture`='%s', `form_id` = %u,`related`='%s', `datum` = NOW() WHERE `id`=%u", mysql_real_escape_string($title), mysql_real_escape_string($korting), mysql_real_escape_string($volg), mysql_real_escape_string($product), intval($product_id), mysql_real_escape_string($visible), mysql_real_escape_string($metadescription), mysql_real_escape_string($url), mysql_real_escape_string($content), mysql_real_escape_string($headerpicture), mysql_real_escape_string($picture), intval($form_id), mysql_real_escape_string($related_string), intval($id)); Quote Link to comment https://forums.phpfreaks.com/topic/280756-sql-unknown-column-title-in-field-list/page/2/#findComment-1443240 Share on other sites More sharing options...
iRoot121 Posted August 2, 2013 Author Share Posted August 2, 2013 Thanks, but I found the problem I think.. If I place a second connection to the database, above the $query_update script, then it works. (gonna look later why that's needed o.O) Thanks for helping me alot! And jazzman1, I'll watch the videos . Quote Link to comment https://forums.phpfreaks.com/topic/280756-sql-unknown-column-title-in-field-list/page/2/#findComment-1443242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.