shage Posted September 10, 2007 Share Posted September 10, 2007 Im trying to do this as a sql query in php by it says no good mysql_query("UPDATE `dirtyblo_wpmu`.`wp_2_options` SET `option_value` = 'a:3:{i:0;s:17:"add-meta-tags.php";i:1;s:43:"all-in-one-seo-pack/all_in_one_seo_pack.php";i:2;s:11:"sitemap.php";}' WHERE `wp_2_options`.`option_id` = 39 AND `wp_2_options`.`blog_id` = 0 AND CONVERT(`wp_2_options`.`option_name` USING utf8) = 'active_plugins' LIMIT 1;") or die("update id $id failed" . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/ Share on other sites More sharing options...
AdRock Posted September 10, 2007 Share Posted September 10, 2007 what is the error? Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/#findComment-345083 Share on other sites More sharing options...
shage Posted September 10, 2007 Author Share Posted September 10, 2007 says syntax on that line Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/#findComment-345086 Share on other sites More sharing options...
AdRock Posted September 10, 2007 Share Posted September 10, 2007 are you trying to update 2 tables? Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/#findComment-345092 Share on other sites More sharing options...
shage Posted September 10, 2007 Author Share Posted September 10, 2007 yes sir Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/#findComment-345107 Share on other sites More sharing options...
shage Posted September 10, 2007 Author Share Posted September 10, 2007 im still having problems Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/#findComment-345373 Share on other sites More sharing options...
MadTechie Posted September 10, 2007 Share Posted September 10, 2007 try this mysql_query("UPDATE `dirtyblo_wpmu`.`wp_2_options` SET `option_value` = 'a:3:{i:0;s:17:\"add-meta-tags.php\";i:1;s:43:\"all-in-one-seo-pack/all_in_one_seo_pack.php\";i:2;s:11:\"sitemap.php\";}' WHERE `wp_2_options`.`option_id` = 39 AND `wp_2_options`.`blog_id` = 0 AND CONVERT(`wp_2_options`.`option_name` USING utf8) = 'active_plugins' LIMIT 1;") or die("update id $id failed" . mysql_error()); Note the " have been escaped \" edit: Option 2 $options = 'a:3:{i:0;s:17:"add-meta-tags.php";i:1;s:43:"all-in-one-seo-pack/all_in_one_seo_pack.php";i:2;s:11:"sitemap.php";}' mysql_query("UPDATE `dirtyblo_wpmu`.`wp_2_options` SET `option_value` = '$options' WHERE `wp_2_options`.`option_id` = 39 AND `wp_2_options`.`blog_id` = 0 AND CONVERT(`wp_2_options`.`option_name` USING utf8) = 'active_plugins' LIMIT 1;") or die("update id $id failed" . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/#findComment-345376 Share on other sites More sharing options...
shage Posted September 10, 2007 Author Share Posted September 10, 2007 thank you trying it now Quote Link to comment https://forums.phpfreaks.com/topic/68640-solved-query-using-php/#findComment-345377 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.