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

Did you know?Explore Trending and Topic pages for more stories like this.
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

Asset Transfer from One plant to another within same company code
Hi,

Please advise how to transfer one asset from one plant to another plant within same c

quick question about System Change Number(SCN) in FlashBack Query topic
i know tht we can get the SCN of the database using flashback concept as follows

SQL>

Packet Design
Hi All,
Im new about network programming and I want to design a protocol but I have some question

PHP time (deadline within one week)
I have a column ['projdue'], which stores the deadline for a project.
I have PHP code and <

Parse multirow HTML table
Hello all,
I have a site I am working on. Its a sports site and I am trying to add stats to a DB

Update not working ... please help
Hi,

I am trying to update a row using an edit form by passing id of the row .. but it is not

How do i use vars in an array
Hiya peeps!

How do I use a var in an array. You will see $id but it isnt working.


What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a c

Using Curl_multi for processing multiple URLs
Hi,

I am at a loss as to how to implement this. I would like to be able to automatically assi

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

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