sefu Posted March 4, 2003 Posted March 4, 2003 I want to test the HTML newsletter on the new server which I have just obtained. The only way I can think to test it without sending to all our customers is to change the status of customers subscribed to the newsletter from status 1 to status 2 in the database and change my status back to 1 for testing What is the SQL command used for PHPMyAdmin to change the status of customers newsletters from 1 to 2? Thanks in advance
mouflon Posted March 4, 2003 Posted March 4, 2003 You can use this little php script: <? $db=mysql_connect("localhost","username","password") or die("Database Connect Error"); mysql_select_db("database_name",$db); $update_sql="update IGNORE customers set customers_newsletter='2'"; $update_result=mysql_query($update_sql) or die ("cant update customers"); } ?> One question, should it not be set to "0" rather than "2"? I just tested it on mine, and with the value at 2, everyone is subscribed, with the value at 0, everyone is unsubscribed. Unexpect the Expected
sefu Posted March 5, 2003 Author Posted March 5, 2003 Thanks I give it a try. If i set the subscribed users to 0, i will not know which subscribers were originally on status 1 thus putting it on 2 :)
mouflon Posted March 5, 2003 Posted March 5, 2003 don't execute the code as shown, then - that will change everyone - just a sec, I'll have revised code for you..... Unexpect the Expected
sefu Posted March 5, 2003 Author Posted March 5, 2003 hang on, doesnt this change the status os everyone to 2? i only want to change the status of customers who are currently on 1 (subscribed) to 2
mouflon Posted March 5, 2003 Posted March 5, 2003 use this instead: $update_sql="update IGNORE customers set customers_newsletter='2' WHERE customers_newsletter='1'"; $update_result=mysql_query($update_sql) or die ("cant update customers"); Unexpect the Expected
mouflon Posted March 5, 2003 Posted March 5, 2003 You can use this little php script: <? $db=mysql_connect("localhost","username","password") or die("Database Connect Error"); mysql_select_db("database_name",$db); $update_sql="update IGNORE customers set customers_newsletter='2'"; $update_result=mysql_query($update_sql) or die ("cant update customers"); } ?> One question, should it not be set to "0" rather than "2"? I just tested it on mine, and with the value at 2, everyone is subscribed, with the value at 0, everyone is unsubscribed. Unexpect the Expected
mouflon Posted March 5, 2003 Posted March 5, 2003 whoops - I should't use the back button on my browser..... :-| Unexpect the Expected
Recommended Posts
Archived
This topic is now archived and is closed to further replies.