|
Posted by Robbo on 07/16/07 19:28
> Hi,
> I'm using PHP, MYSQL
> My code - - -
> $donor_db = "donor_database";
> $new_db = "new_database";
> $db_conn = mysql_connect($host, $user, $pass);
> //get a list of all tables in the donor database
> mysql_select_db($donor_db, $db_conn);
> $query2 = "Show tables from ".$donor_db;
> $result2 = mysql_query($query2);
> $array2 = mysql_fetch_array($result2);
> //there are 40 tables in the donor database
> My Problem 1 ---
> foreach ($array2 as $table_name)
> {
> echo $table_name."<br>";
> }
> //in the browser this returns the first table listed twice - -
> //
> //accounts
> //accounts
> My problem 2 - - -
> while ($array2 = mysql_fetch_row($result2))
> {
> echo $array2[0]."<br>";
> }
> //in the browser this returns 39 table names excluding the first one
> (accounts)
> TIA - Any help much appreciated
this is a PHP problem!
--
POST BY: lark with PHP News Reader
Navigation:
[Reply to this message]
|