Been trying this for MONTHS. Time to ask for help. I want to take sql table data and turn it into a mailing list for wp_mail using PHP. This code turns up blank, but I can't find anything online aside from that.
$results = $wpdb->get_results("SELECT * FROM $table_name WHERE accepting_emails='Yes'");
foreach($results as $emaillist) {
echo $emaillist->email.",";
}
I have attempt several changes and getting nothing in return. Mostly says parse error. I've tried creating an array with the foreach function but I'm not sure I'm doing it right, I've tried references, and more still not getting the result. Any suggestions?