elyfrank Posted March 21, 2013 Share Posted March 21, 2013 (edited) 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()); ?> Edited March 21, 2013 by elyfrank Quote 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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/275949-changing-a-value-on-table/#findComment-1420343 Share on other sites More sharing options...
Solution elyfrank Posted March 22, 2013 Author Solution 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';") Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.