如何在MYSQL中连接master数据库中的子数据库?

时间:2014-06-24 09:43:34

标签: php mysql

  

您好   我有master数据库,它包含多个子数据库和no.of表   在每个子数据库中。现在我想更新子数据库表。那么如何在php中连接>子数据库。   请帮帮我。

代码:

的index.php

  <?php
   include 'includes/connection.php';

   $query="SELECT * FROM account_info";

   $result=mysql_query($query);

   while ($user=mysql_fetch_array($result)) {
echo "<h3>" .$user['account_status'] . "</h3>";
   }

   ?>

connection.php

 <?php

   $dbhost='localhost';
   $dbuser='';
   $dbpassword='';

   $dbname=  'movico_1496_123456';

   $conn=mysql_connect('$dbhost','$dbuser','dbpassword');
   mysql_select_db($dbname) or die("unable to connect to  the database");

   ?>

0 个答案:

没有答案
相关问题