[asterisk-users] PHP can't insert - Can someone please help

Zeeshan Zakaria zishanov at gmail.com
Sat Jul 10 07:28:03 CDT 2010


Its not wise to haste in posting for help without first spending sometime
thinking yourself. Your mysql syntax is not right, you can clearly see the
missing single quotes starting from 'ext-local. I would also suggest to use
a different syntax for this mysql statement, i.e. using SET instead of
VALUES, which makes the syntax much clearer, i.e. INSERT INTO `table` SET
`col1` =  'value1', `col2`= 'val2' and so on.

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-07-10 12:13 AM, "bruce bruce" <bruceb444 at gmail.com> wrote:

Hi Guys,

I am making another module for Voicemail. I have three fields in a POST form
that have to be connected together to make it a single 10 digit number but
there is something wrong in my syntax probably.


$npaa = "('$_POST[anpa]')";
$nxxa = "('$_POST[anxx]')";
$blocka = "('$_POST[ablock]')";

*$grplist = $npaa.$nxxa.$blocka;*

$sql="INSERT INTO findmefollow(grpnum, strategy, grptime, grppre, grplist,
annmsg_id, postdest, dring, needsconf, remotealert_id, toolate_id, ringing,
pre_ring)
VALUES ('$_POST[grpnum]','ringall','$_POST[grptime]','$_POST[grppre]',$grplist,'0','$_POST[postdest]','','','0','0','Ring','$_POST[pre_ring]')";


It seems that $grplist is the problem. Can someone please point what is
wrong?

Error:
Error: 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
'('333')('4444'),'0','ext-local,vmb2000,1','','','0','0','Ring','0')' at
line 3

Thanks,
Bruce

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100710/31c11ee7/attachment.htm 


More information about the asterisk-users mailing list