AN-net
07-22-2004, 12:35 AM
ok im getting an mysql syntax error saying:
Invalid SQL: INSERT INTO journals
(journalist,journalist_id,journaldate,journaldesc, private,whocanview,lastentry,
lastentry_date,ipaddress,journalname)
VALUES ('Shon','6','1090459535','The only game dog journal',
'0','','Issue #1','1090459535','65.12.191.223'
,'Sporting Dog Journal'
mysql 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 '' at line 6
here is my code:
$nameformat=",'".addslashes($jname)."'";
$DB_site->query_first("INSERT INTO ".TABLE_PREFIX."journals
(journalist,journalist_id,journaldate,journaldesc, private,whocanview,lastentry,
lastentry_date,ipaddress".iif($_POST['usejname']=='1', ',journalname').")
VALUES ('".addslashes($journalist)."','".intval($journalistid)."','".TIMENOW."','".addslashes($jdesc)."',
'".$jpriv."','".addslashes($whocanviewj)."','".addslashes($etitle)."','".TIMENOW."','".$REMOTE_ADDR."'
".iif($_POST['usejname']=='1', $nameformat)."
");
anyone know y cause having nothing in a field for an insert query has never given me a problem before>_>
Invalid SQL: INSERT INTO journals
(journalist,journalist_id,journaldate,journaldesc, private,whocanview,lastentry,
lastentry_date,ipaddress,journalname)
VALUES ('Shon','6','1090459535','The only game dog journal',
'0','','Issue #1','1090459535','65.12.191.223'
,'Sporting Dog Journal'
mysql 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 '' at line 6
here is my code:
$nameformat=",'".addslashes($jname)."'";
$DB_site->query_first("INSERT INTO ".TABLE_PREFIX."journals
(journalist,journalist_id,journaldate,journaldesc, private,whocanview,lastentry,
lastentry_date,ipaddress".iif($_POST['usejname']=='1', ',journalname').")
VALUES ('".addslashes($journalist)."','".intval($journalistid)."','".TIMENOW."','".addslashes($jdesc)."',
'".$jpriv."','".addslashes($whocanviewj)."','".addslashes($etitle)."','".TIMENOW."','".$REMOTE_ADDR."'
".iif($_POST['usejname']=='1', $nameformat)."
");
anyone know y cause having nothing in a field for an insert query has never given me a problem before>_>