Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Проблема с SUB SELECT

Опубликовано:
===================================================

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

 

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

Рекомендованные сообщения

Опубликовано:

/ips_kernel/class_db.php

 

define( 'IPS_DB_ALLOW_SUB_SELECTS', 0 );

 

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

  • 9 месяцев спустя...
Опубликовано:

Спасибо помогло мне!

Опубликовано:

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

 

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

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

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

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.