Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка 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.

Проблема с запросом к БД

Featured Replies

Posted

Есть у меня такой запрос к БД 

$this->DB->build(array(
				'select'   => 't.*',
				'from'     => array('xmod_tables'=>'t'),
				'order'    => 'level DESC',
				'add_join' => array(
									array(
											'select' => 'n.name',
											'from' => array( 'xmod_vehicle_nations' => 'n' ),
											'where' => 't.nation=n.nation',
											'type' => 'left'
										),
									array(
											'select' => 'tp.name',
											'from' => array( 'xmod_vehicle_types' => 'tp' ),
											'where' => 't.type=tp.type',
											'type' => 'left'
										),
								)
			));
$result = $this->DB->execute();

while($a = $this->DB->fetch($result))
{
и тут проблема
}
Проблема заключается в том что после получение строки у меня одно значение name (последней таблицы), а на самом деле у меня их 3 в каждой таблице есть такое поле.
Вопрос как мне достать все 3 значения ?

  • Author

вышел с ситуации таким образом:

$this->DB->build(array(
				'select'   => 't.*',
				'from'     => array('xmod_tables'=>'t'),
				'order'    => 'level DESC',
				'add_join' => array(
									array(
											'select' => 'n.name as nation_name',
											'from' => array( 'xmod_vehicle_nations' => 'n' ),
											'where' => 't.nation=n.nation',
											'type' => 'left'
										),
									array(
											'select' => 'tp.name as type_name',
											'from' => array( 'xmod_vehicle_types' => 'tp' ),
											'where' => 't.type=tp.type',
											'type' => 'left'
										),
								)
			));
$result = $this->DB->execute();

И теперь у меня есть поля namenation_name и type_name

Guest
This topic is now closed to further replies.

Последние посетители 0

  • No registered users viewing this page.

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.