PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$mail = "SELECT mailing_users.email,mailing_lists.list_text FROM mailing_users,mailing_lists WHERE mailing_users.list_id=mailing_lists.list_id AND mailing_users.list_id=".$list."";
$mr = mysql_fetch_assoc($mq);
I thought putting '.$mr['email'].' in the textarea would pull from the row and insert that variable into the messge. It doesn't work. Any ideas on the best way to get this working?
$mail = "SELECT mailing_users.email AS email,mailing_lists.list_text AS list_text FROM mailing_users,mailing_lists WHERE mailing_users.list_id=mailing_lists.list_id AND mailing_users.list_id='$list'";
$mq=mysql_query($mail) or die ("Couldn't access query"); // need to do the query!
$mr = mysql_fetch_assoc($mq);
Need to do the query!
Also added to AS to name what you are grabbing.
No idea about the class. I'd add some echo's to see that the query is doing what you want it to before trying to get mail() working! Oh and the header needs an \r\n
So are you saying the problem is not with the code thus posted, but with a form the admin is using? In other words the form has posted $mr['email'] as is rather than contents of that variable to the database?