vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Using $DB object on other databases than vB? (https://vborg.vbsupport.ru/showthread.php?t=141032)

RoutineX 03-03-2007 01:49 PM

Using $DB object on other databases than vB?
 
I'm trying to write my first product in vB and had some problems with the database connectivity.

I have some data on another database that I don't want to insert into the vB database.

Shouldn't it be enough to give select access to the other database on the vB user and than do a query like:

$somevar = $db->query_first("SELECT blabla FROM unixusername_otherdb.table");

I guess I could install mysql 5 and create a view, but was wondering if there was any other ways.

Thanks =)

Cap'n Steve 03-05-2007 01:01 AM

I think the database connection can only deal with one database, although it looks like you know just as much about MySQL as me.

Adrian Schneider 03-05-2007 01:11 AM

You could create a second database object for your other database.

version2 06-03-2007 05:50 PM

Quote:

Originally Posted by SirAdrian (Post 1195870)
You could create a second database object for your other database.

How would one do that with VB's database class?

Eikinskjaldi 06-03-2007 09:35 PM

Whilst you could create a second object, you were correct the first time.

Quote:

Shouldn't it be enough to give select access to the other database on the vB user and than do a query like:

$somevar = $db->query_first("SELECT blabla FROM unixusername_otherdb.table");

will work. You can also join across databases.


All times are GMT. The time now is 05:43 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02169 seconds
  • Memory Usage 1,712KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete