You are here: Cannot get SHOW TABLES to produce ALL tables ! « PHP Programming Language « IT news, forums, messages
Cannot get SHOW TABLES to produce ALL tables !

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация