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

Oracle11g Patch issue
Hi all,

I'm getting the following error while installing Oracle11g Patch 11.1.0.7.0 on IBM-AI

Images outside webroot
Im hopeing someone can help me with this because i cant figure it out.I have setup an ASP.NET websit

Inserting into MySQL Newbie
Hi ive got a slight problem where ive made a simple web form where the customer inserts the ammount

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

Encrypt php code?
Is it possible to encrypt php code in files,
so that it displays a load of unreadable characters

Why Are These Functions Causing MASSIVE Memory Problems? Please Help!
Hi,

I have a script with some options.

I use regex to replace patterns in strings, but

Gridview Not updating in Update Panel
I have a gridview, three dropdown list boxes, and a button on my form. What is displayed in the gri

Buggy registration system
Hey, I just started scripting in PHP, and I ran into a few problems.
Code: <?php
includ

POST into Array problem
Hi Chaps,

I have a repeat region, displaying rows of data: jobid, fromtable, translatorcharge

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