Jump to content

[SOLVED] Query using php


shage

Recommended Posts

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());

Link to comment
https://forums.phpfreaks.com/topic/68640-solved-query-using-php/
Share on other sites

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());

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.