MASS PM


Posted on 16th Feb 2014 07:03 pm by admin

Hello all, I'm trying to send mass private messages to users in my database but keep getting an error... and was hoping someone could help me out.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''john ','Support Staff ','October 20, 2009, 9:32 pm ','Test Message','Test mess' at line 1

Not sure if it's a problem cycling through all the users or what the issue is.


$getmembers = mysql_query("SELECT * FROM user");
$num_rows= mysql_num_rows($getmembers);
while($r =mysql_fetch_array($getmembers)){
$subject = $_POST['subject'];
$message = $_POST['message'];
$from="Support Staff";
$date = date("F j, Y, g:i a");
$to=$r['Fname'];
$spm = mysql_query("INSERT INTO `private_msg` (`to`,`from`,`date`,`subject`,`content`) VALUES '$to ','$from ','$date ','$subject','$message')") or die(mysql_error());
}


Thanks in advance!!

No comments posted yet

Your Answer:

Login to answer
168 Like 18 Dislike
Previous forums Next forums
Other forums

Clean URLs
Hi I was wandering if anyone has ever implemented URLs on their PHP run website using URLS like wiki

Comma seperated implode & modifying returned string.
I have a PHP post form that posts up to 4 variables. I need whatever variables are passed to be comb

Gaining access to Drop Down Menu Variable
code is below, I am creating a drop down menu. I want to echo the value selected in the drop down me

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

Good Programming and Web Design Books
Hi,

I recived a pm today from a fellow phpfreaker regarding php books, i replied with the fo

Any decent php formatter/beautifier/pretty printer?
Any decent php formatter/beautifier/pretty printer class/function?

I found the following whil

Just wondering what you think about my site
I am new to phpfreaks i just seen this form and thought it would be cool to see what other thought a

Using Microsoft Exchange Server with PHP
Hi,

I wanted to know if its possible to fetch email attachments from the exchange server usin

Keep newlines from textarea?..
I'm creating a simple encoding program, and what I want it to do is retain the newlines, as echoing

rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash