Members: 16,996
Threads: 38,831
Posts: 159,349
Online: 30

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 15.03.2005, 20:05   #1 (permalink)
Baby Mamber
 
Join Date: Apr 2004
Posts: 1
ottoplanet is on a distinguished road
Default how to query a different database

Hallo,

I want to query a second database in a component.

How can I do that?.

I tryed to open a db

$dbextern = MYSQL_CONNECT($row->moblogDBHostName, $row->moblogDBUserName, $row->moblogDBPassword) OR DIE("Error !! Unable to connect to database");

select a table

mysql_select_db('externdb') or die( "Unable to select database ".$row->moblogDBTable);

start my query.

After getting the correct data from the query I closed the database.

mysql_close($dbextern);

Now I want to insert parts from the queryresults into the mambo database but the following query is looking in the false database for the table.

$database->setQuery("INSERT INTO mos_content ( title, title_alias, introtext, state, sectionid, catid) VALUES ('$post_mail_subject','$post_mail_subject','$post_ mail_body','1','$mossectionid','$moscatid')" );

I get the Error:
Table 'externdb.mos_content' doesn't exist SQL=INSERT INTO mos_content ( title, title_alias, introtext, state, sectionid, catid) VALUES ...

Hope anybody can help me.

Thanks
ottoplanet is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
database query? boboras Component Development 13 09.04.2005 11:15
Database Query 1.0 Released tcp Development Announcements 0 08.03.2005 15:03
Calling data from a database in a Content Item BobDonut Mambo 4.5.1 'How Do I' Questions 1 25.02.2005 17:30
query mysql database for reports using Mambo grieverr Mambo 4.5.1 'How Do I' Questions 0 09.11.2004 23:32
mambo and mysql database query through a form with php Mupid Mambo 4.5 'How Do I' Questions 0 14.10.2004 15:10


All times are GMT +2. The time now is 05:07.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.