anonīms Posted March 16, 2010 Report Share Posted March 16, 2010 Nekad neesmu strādājis ar divām datubāzēm un pat īsti neatradu netā normālu dokumentāciju, kur būtu rakstīts kā lietot 2 db. Man izmet erroru mysql_query(): supplied argument is not a valid MySQL-Link resource in Mana konekcija: http://paste.php.lv/cae7580df3f33378f3e6c2a078ef17cf?lang=php Mans kods: http://paste.php.lv/e63b8a1639fe5f87842bbe130b8d3b9c?lang=php Cik sapratu, tad es kaut ko daru nepareizi :D (not2easy) Quote Link to comment Share on other sites More sharing options...
briedis Posted March 16, 2010 Report Share Posted March 16, 2010 (edited) mysql_query($query, $db_connection); rtfm - read the fine manual :) - http://php.net/manual/en/function.mysql-query.php Edited March 16, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
waplet Posted March 16, 2010 Report Share Posted March 16, 2010 $db1 = mysql_select_db("datubaze1"); $db2 = mysql_select_db("datubaze2"); mysql_query("kverījs",$db1); mysql_query("kverījs",$db2); Quote Link to comment Share on other sites More sharing options...
marcis Posted March 16, 2010 Report Share Posted March 16, 2010 waplet, kur tu tādus brīnumus atradi? Bet vispār drīkst darīt arī tā - vienam datubāzes lietotājam piešķirt pieeju abām datubāzēm (te runa ir par gadījumu, ka divas datubāzes atrodas uz viena servera) un sastādot kveriju norādīt, kura tabula atrodas kurā datubāzē "FROM `datubāze`.`tabula`". Cik nu šis ir parocīgi - atkarīgs no situācijas. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.