dtdetu Posted December 15, 2008 Share Posted December 15, 2008 hello i am trying to add a url to database but it gives this error, it works for simple urls but now with this one SubmittingYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1', 'http://hosted.ap.org/dynamic/stories/W/WHITE_HOUSE_BARNEY_CAM?SITE=RIPRJ&SE' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/ Share on other sites More sharing options...
ngreenwood6 Posted December 15, 2008 Share Posted December 15, 2008 are you running it throught the: mysql_real_escape_string() Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716010 Share on other sites More sharing options...
dtdetu Posted December 15, 2008 Author Share Posted December 15, 2008 yes but still same error Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716017 Share on other sites More sharing options...
gevans Posted December 15, 2008 Share Posted December 15, 2008 can you show your INSERT query and the URL? Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716021 Share on other sites More sharing options...
dtdetu Posted December 15, 2008 Author Share Posted December 15, 2008 yes here it is $r[url] = mysql_real_escape_string($r[url]); $newq=mysql_query("INSERT INTO `dizzedc_dizzed`.`pligg_links` (`link_id`, `link_author`, `link_status`, `link_randkey`, `link_votes`, `link_reports`, `link_comments`, `link_karma`, `link_modified`, `link_date`, `link_published_date`, `link_category`, `link_lang`, `link_url`, `link_url_title`, `link_title`, `link_title_url`, `link_content`, `link_summary`, `link_tags`, `link_field1`, `link_field2`, `link_field3`, `link_field4`, `link_field5`, `link_field6`, `link_field7`, `link_field8`, `link_field9`, `link_field10`, `link_field11`, `link_field12`, `link_field13`, `link_field14`, `link_field15`, `link_editor_pick`) VALUES (NULL, '$sender', 'published', '7500757', '1', '0', '0', '1.00', NOW(), NOW(), NOW(), '1, '1', '$r[url]', '$r[title]', '$r[title]', '$urlnew', '$r[description]', '$r[description]', NULL, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1')") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716022 Share on other sites More sharing options...
gevans Posted December 15, 2008 Share Posted December 15, 2008 sorry, can I see the actual url (what's going into the form) Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716028 Share on other sites More sharing options...
dtdetu Posted December 15, 2008 Author Share Posted December 15, 2008 sorry url is here http://hosted.ap.org/dynamic/stories/W/WHITE_HOUSE_BARNEY_CAM?SITE=RIPRJ&SECTION=HOME&TEMPLATE=DEFAULT Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716032 Share on other sites More sharing options...
gevans Posted December 15, 2008 Share Posted December 15, 2008 is this field a VARCHAR? if so what length? Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716039 Share on other sites More sharing options...
dtdetu Posted December 15, 2008 Author Share Posted December 15, 2008 its varchar 255 Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716042 Share on other sites More sharing options...
premiso Posted December 15, 2008 Share Posted December 15, 2008 '1, '1', '$r[url]', You are missing a closing single quote. '1', '1', '$r[url]', Exactly where SQL told you the error was. Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716074 Share on other sites More sharing options...
dtdetu Posted December 15, 2008 Author Share Posted December 15, 2008 wow how did you notice it thank you very much i was fightign with it for hours Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716081 Share on other sites More sharing options...
premiso Posted December 15, 2008 Share Posted December 15, 2008 wow how did you notice it thank you very much i was fightign with it for hours Umm I used the MySQL error and looked at where it was throwing the error. It wasn't rocket science...at least I do not think it was. Quote Link to comment https://forums.phpfreaks.com/topic/137091-solved-url-to-database-help-please/#findComment-716084 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.