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

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

Formatting echo from database
So I have a database that stores First and last names, then echos them back to a website, as of now

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Comparing two dates
Hi Guys
I have two dates I want to compare. Below is my current implementation. The problem with

Return X values where an ID number doesnt matter
Well as for subject heading, thats the best i could think of.

Currently im having a problem w

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

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