latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

error log show bad sql syntax

Home Forums Community Forum error log show bad sql syntax

This topic contains 1 reply, has 2 voices. Last updated by  Attila Bus 3 years, 5 months ago.

Topic Author Topic
Posted: Saturday Feb 23rd, 2013 at 12:29 pm #43049
Oriol Boan
Username: orboan

Hi, i have the next error log regarding sql syntax. I show just one entry log, but it appears lots of times:

[23-Feb-2013 15:57:21] Error a la base de dades del WordPress 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 1 a la consulta SELECT post_type FROM clh_posts WHERE ID= feta per require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, c_ws_plugin__s2member_constants::constants, c_ws_plugin__s2member_cache::cached_page_links, get_page_link, apply_filters('page_link'), call_user_func_array, SitePress->permalink_filter

How to solve this error? May I have to modify some php file?

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Monday Aug 5th, 2013 at 7:25 pm #55249
Attila Bus
Username: Battman

I have experienced the same problem and it seems, there is a conflict between s2Member and WPML plugins.
WPML adds permalink_filters in file sitepress.class.php:
// posts and pages links filters
add_filter(‘post_link’, array($this, ‘permalink_filter’),1,2);
add_filter(‘post_type_link’, array($this, ‘permalink_filter’),1,2);
add_filter(‘page_link’, array($this, ‘permalink_filter’),1,2);

and in the filter itself there is a database query, which causes the error:

function permalink_filter($p, $pid){
global $wpdb;
$pid = $pid->ID;
$post_type = $wpdb->get_var(“SELECT post_type FROM {$wpdb->posts} WHERE ID={$pid}”);

I suppose, the problem is that $pid is not set … its value gets lost somewhere in the chain of functions listed also in the error message.

For me, this error occured only, when I saved a page in the editor.

A temporary solution is to deactivate s2Member and then activate it again. I suspect some caching problem as it is also in the error message: c_ws_plugin__s2member_cache::cached_page_links

I wrote these details to help s2Member team to figure out the problem…


Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.