We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

SQL Syntax error or access violation | Forum

Klaus Rock
Klaus Rock Jul 5 '18

System crashes when there is a Apostrophe Sign in Newsfeed.


Klaus

dave Leader
dave Jul 5 '18
Hi, does your server meet the requirements on the right side of this page? 


https://developers.oxwall.com/hosting


Are you using cloudflare ?


What version of PHP ?

What version of MySql ?

What OS are you running ?  (centOS ?)




Klaus Rock
Klaus Rock Jul 5 '18

PHP Version 5.5.38


mySQL Version mysql  Ver 14.14 Distrib 5.7.22, for Linux (x86_64) using  EditLine wrapper


OS

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial


See attached Crash Report

Klaus Rock
Klaus Rock Jul 5 '18
Something went wrong!
To get the error details follow these steps:
- Open ow_includes/config.php file and set DEBUG_MODE to true
- Reproduce your last action.

Error details:
Type:     Exception
Message:     SQLSTATE[42000]: Syntax error or access violation: 1064 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 'type":"link","description":"
Dua Lipa Tour 2018 Concerts Tickets now available on' at line 1
File:     /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/database.php
Line:     723
Trace:     
#0 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/database.php(723): PDOStatement->execute()
#1 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/database.php(344): OW_Database->execute('SELECT * FROM o...', NULL)
#2  /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_plugins/newsfeed/bol/like_dao.php(172): OW_Database->queryForObjectList('SELECT * FROM o...', 'NEWSFEED_BOL_Li...')
#3 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_plugins/newsfeed/bol/service.php(519): NEWSFEED_BOL_LikeDao->findByEntityList(Array)
#4 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_plugins/newsfeed/components/feed_list.php(101): NEWSFEED_BOL_Service->findLikesByEntityList(Array)
#5 [internal function]: NEWSFEED_CMP_FeedList->__construct(Array, Array)
#6 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/ow.php(492): ReflectionClass->newInstanceArgs(Array)
#7 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/ow.php(456): OW::getClassInstanceArray('NEWSFEED_CMP_Fe...', Array)
#8 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_plugins/newsfeed/components/feed.php(230): OW::getClassInstance('NEWSFEED_CMP_Fe...', Array, Array)
#9 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_plugins/newsfeed/components/feed.php(255): NEWSFEED_CMP_Feed->createFeedList(Array, Array)
#10 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/renderable.php(124): NEWSFEED_CMP_Feed->render()
#11 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/view.php(183): OW_Renderable->onRender()
#12 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/component.php(80): OW_View->render()
#13 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/renderable.php(124): OW_Component->render()
#14 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/view.php(183): OW_Renderable->onRender()
#15 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/component.php(80): OW_View->render()
#16 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_system_plugins/base/components/drag_and_drop_item.php(332): OW_Component->render()
#17 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_system_plugins/base/components/drag_and_drop_item.php(317): BASE_CMP_DragAndDropItem->render()
#18 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_system_plugins/base/components/drag_and_drop_frontend_panel.php(110): BASE_CMP_DragAndDropItem->renderView()
#19 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_smarty/template_c/ffedcef3b173db59a9507ab5d59cf34bbb3abbd6_0.file.drag_and_drop_index.html.php(152): BASE_CMP_DragAndDropFrontendPanel->tplComponent(Array, Object(Smarty_Internal_Template))
#20 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_libraries/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(122): content_5b20c9f6c48e92_22870841(Object(Smarty_Internal_Template))
#21 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_libraries/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(199): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#22 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_libraries/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(159): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#23 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_libraries/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(191): Smarty_Internal_Template->render(false, 0)
#24 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_libraries/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(94): Smarty_Internal_TemplateBase->_execute('/var/www/vhosts...', NULL, NULL, NULL, 0)
#25 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/view_renderer.php(80): Smarty_Internal_TemplateBase->fetch('/var/www/vhosts...')
#26 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/view.php(187): OW_ViewRenderer->renderTemplate('/var/www/vhosts...')
#27 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/component.php(80): OW_View->render()
#28 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/renderable.php(124): OW_Component->render()
#29 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/view.php(183): OW_Renderable->onRender()
#30 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_system_plugins/base/controllers/component_panel.php(56): OW_View->render()
#31 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/request_handler.php(258): BASE_CTRL_ComponentPanel->render()
#32 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/request_handler.php(226): OW_RequestHandler->processControllerAction(Object(ReflectionMethod), Object(BASE_CTRL_ComponentPanel))
#33 /var/www/vhosts/tennis-motion-connect.com/httpdocs/ow_core/application.php(346): OW_RequestHandler->dispatch()
#34 /var/www/vhosts/tennis-motion-connect.com/httpdocs/index.php(76): OW_Application->handleRequest()
#35 {main}

dave Leader
dave Jul 5 '18
If you are running the questions plugin, deactivate it.  Its causing the issue, and contact the developer for bug fix.
Klaus Rock
Klaus Rock Jul 6 '18

Thank you Dave.


The questions plugin is not installed.


Think it is this error:


https://stackoverflow.com/questions/2206326/sql-error-when-using-apostrophes


This bug should be fixed in the PHP Code.


Klaus

Lee
Lee Jul 6 '18
I would say it's probably this here:  'type":"link","description":"


Should be "type" not 'type"

Lee
Lee Jul 6 '18
Tickets now available on' at line 1  


There's an apostrophe after the on that might also be causing issues


If I am wrong, Dave owes you a beer ... :)

dave Leader
dave Jul 6 '18
I missed that, good catch Lee 
Klaus Rock
Klaus Rock Jul 9 '18

Before submitting with a SQL Command simply check Text and correct ' with ''' or similar.


Prost



Klaus Rock
Klaus Rock Jul 12 '18

In which Table and Field the News-feed or Live Stream Feed is stored ?


It is very annoying to restore the nightly Backup and loose one day because of that.


At the moment this happens every 2 weeks.


Would appreciate assistance and help.


Thank you

Klaus



Daniel
Daniel Apr 22 '21
Hi, was this issue ever fixed or a solution found? 
killersmile
killersmile May 10 '21
great site! glad i found this. any recent updates? [url=https://bathroomremodelingfortwayne.com]bathroom remodelers near me[/url]