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

pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help

Change of partner analyse in sales orders
Hello,

I changed the partner analyse for sales orders and added a new mandatory partnerro

More pug propaganda.
http://www.youtube.com/watch?v=8Kkrmubsgf8

The commercial is definitely worth watching pug aw

Passing vars to the DB
I have 3 small testing tables:

ID TYPE
1 pepperoni
2 C. bacon
3 taco

ID TY

parameter passing issue on function
Well I thought I had created a pretty slick web page, using ?page and $_GET to load pages which wher

Revoking alter any table from a schema
Hi All,

i am working in Oracle 10g.
my requirement is to revoke all kind of DDL oper

How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

reating a background image
I am building a site in drupal and have a php form in it, due to certain annoyances with module buil

Problem with array max size.
Hi to everyone,
I've got a homework about filling a bidimensional array un spiral shape, I alre

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