TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 316
  • Total: 317
  • @rjen

Database error and article submission with apostrophe

Started by fotografo74, May 25, 2010, 08:06:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fotografo74

Hi :-)
I use TP 1.0 beta 5-1 and SMF RC3 www.macroforum.org
My user have this error when they submit articles:

Database 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 'acqua','prova l'acqua ','0','','0','prova ','21','angelica','theme','0','0','dat' at line 2

The error is in the TPmodules.php files at line 619:


VALUES('".$artd."','".$artbb."','".$arti."','".$artu."','".$artc."','".$artf."','".$arts."','".$nameb."','".$name."','".$artframe."','".$artpp."','0','".$artoptions."',0,0,'',0,'','',0,'','".$artimp."', '".$arttype."')", __FILE__, __LINE__);


I think that is apostrophe in article's  title or description...
How can i fix this?
Thanks
Antonio

ZarPrime

If you search the bugtracker for the word "apostrophe" you will see that several bugs have been reported.  As far as I know, Bloc has not posted a fix for these yet but they should be fixed for the next update (TP 1.0 beta 5.2) when he releases it.

ZarPrime

fotografo74

Ok, thanks :-)
For now my friend has patched the TPmodules.php by this way:

line 618 to 620
$request = tp_query("INSERT INTO " . $tp_prefix . "articles (date,body,intro,useintro,category,frontpage,subject,author_id,author,frame,approved,off,options,parse,comments,comments_var,views,rating,voters,ID_THEME,shortname,fileimport,type)
VALUES('".addslashes($artd)."','".addslashes($artbb)."','".addslashes($arti)."','".addslashes($artu)."','".addslashes($artc)."','".addslashes($artf)."','".addslashes($arts)."','".addslashes($nameb)."','".addslashes($name)."','".addslashes($artframe)."','".addslashes($artpp)."','0','".addslashes($artoptions)."',0,0,'',0,'','',0,'','".addslashes($artimp)."', '".addslashes($arttype)."')", __FILE__, __LINE__);


line 626

tp_query("INSERT INTO " . $tp_prefix . "variables (value1,value2,value3,type,value4,value5 ) VALUES ('".addslashes($title)."','$now', '','art_not_approved', '' , $newitem)", __FILE__, __LINE__);


and works :-)
Antonio

This website is proudly hosted on Crocweb Cloud Website Hosting.