Jump to content
Дизайн и модификация Invision Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
SiZE

Проблема с SUB SELECT

Recommended Posts

===================================================

Date: Tue, 30 Oct 2007 12:49:39 +0300

Error Number: 0

Error:

IP Address: 86.109.196.238

SUB SELECT query joins are not allowed.

Add $this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them

===================================================

 

Что удалось выяснить:

 

/ips_kernel/class_db_mysql_client.php

 

//-----------------------------------------

// Stop sub selects? (UNION)

//-----------------------------------------

 

if ( !IPS_DB_ALLOW_SUB_SELECTS )

{

# On the spot allowance?

 

if ( ! $this->allow_sub_select )

{

$_tmp = strtolower( $this->remove_all_quotes($the_query) );

 

if ( preg_match( "#(?:/\*|\*/)#i", $_tmp ) )

{

$this->fatal_error( "You are not allowed to use comments in your SQL query.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );

return false;

}

 

if ( preg_match( "#[^_a-zA-Z]union[^_a-zA-Z]#s", $_tmp ) )

{

$this->fatal_error( "UNION query joins are not allowed.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );

return false;

}

else if ( preg_match_all( "#[^_a-zA-Z](select)[^_a-zA-Z]#s", $_tmp, $matches ) )

{

if ( count( $matches ) > 1 )

{

$this->fatal_error( "SUB SELECT query joins are not allowed.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them");

return false;

}

}

}

}

 

Добавлял $this->DB->allow_sub_select=1;, перед $db_skin = $this->DB->simple_exec_query( array( 'select' =..., в файле source/ipsclass.php, откуда вываливается ошибка, не помогает :) Начинает вываливать вот что:

 

mySQL query error: UPDATE ibf_members SET login_anonymous='&1', last_visit=last_activity, last_activity=1193812412, last_ip='86.109.196.238' WHERE id=18SELECT set_cache_css,set_cache_wrapper,set_cache_macro,set_image_dir,set_emoticon_folde

r,set_skin_set_id,set_name,set_css_method FROM ibf_skin_sets WHERE set_skin_set_id=2

 

SQL 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 'set_cache_css,set_cache_wrapper,set_cache_macro,set_image_dir,set_emoticon_f

olde' at line 1

SQL error code: 1064

Date: Wednesday 31st of October 2007 09:33:32 AM

 

Ошибка выпадает вот в каком случае: пользователь регистрируется, заходит, его авторизирует и вываливается ошибка. Те кто уже был зареган без проблем заходят :)

Share this post


Link to post

/ips_kernel/class_db.php

 

define( 'IPS_DB_ALLOW_SUB_SELECTS', 0 );

 

пробовали дать константе значение 1 ?

Share this post


Link to post

вообще я буквально месяца два-три назад столкнулся с таким же, при написании мода.

 

Ошибка оказалась банальной. Я пропустил важную часть в коде после запроса в БД, а именно

$this->ipsclass->DB->simple_exec();

если конечно мне не изменяет память. Так что советую проверить скрипт.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...