elyfrank Posted March 21, 2013 Share Posted March 21, 2013 Hi guys,I know a little bit of PHP but I am very new to mysql.How do I change the value (meta_value) of all the wp_s2member_login_counter in this table (wp_usermeta) using php? Thank you very much!This is what I got so far:<?php// Connect to MySQL$link = mysql_connect('mywebsite.com', 'wrd6rEDgggy', 'password');if (!$link) { die('Could not connect: ' . mysql_error());}echo 'Connected successfully';mysql_select_db(wrd_47io4f3a6l);$result = mysql_query("UPDATE wp_usermeta SET wp_s2member_login_counter='0'")or die(mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/275949-changing-a-value-on-table/ Share on other sites More sharing options...
DaveyK Posted March 22, 2013 Share Posted March 22, 2013 and this code doesnt work? Whats the problem? Link to comment https://forums.phpfreaks.com/topic/275949-changing-a-value-on-table/#findComment-1420284 Share on other sites More sharing options...
Maq Posted March 22, 2013 Share Posted March 22, 2013 mysql_select_db() takes a String not a constant. If that doesn't work tell us what happens, errors, etc. Link to comment https://forums.phpfreaks.com/topic/275949-changing-a-value-on-table/#findComment-1420343 Share on other sites More sharing options...
elyfrank Posted March 22, 2013 Author Share Posted March 22, 2013 I just fix it. Thank you guys. $result = mysql_query("UPDATE wp_usermeta SET meta_value='0' WHERE meta_key = 'wp_s2member_login_counter';") Link to comment https://forums.phpfreaks.com/topic/275949-changing-a-value-on-table/#findComment-1420347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.