jkkenzie Posted April 4, 2008 Share Posted April 4, 2008 Hi! Brothers, i would like to list all tables from mysql database on my page then make them hyperlinks or links that when clicked, opens the page displaying the clicked table fields. Is there a short easy example or a way of doing it. Simple code, or anybody with a way out that works good. Thanks guys, ............. Link to comment https://forums.phpfreaks.com/topic/99490-list-tables-fields-on-page/ Share on other sites More sharing options...
sasa Posted April 4, 2008 Share Posted April 4, 2008 use SHOW TABLES in sql look http://dev.mysql.com/doc/refman/5.0/en/show-tables.html Link to comment https://forums.phpfreaks.com/topic/99490-list-tables-fields-on-page/#findComment-509019 Share on other sites More sharing options...
jkkenzie Posted April 4, 2008 Author Share Posted April 4, 2008 The config.php and tablelist.php below shows only one table, how can i make it show several tables? ------------------ config.php -------------------- <?php $TableData['0@strBanks'] = "0 0 1"; $Tables['0'] = "strBanks"; $TableNames['0'] = "tblbanks"; $FKInfo['0'] = ""; $Delete = True; $Add = True; $Edit = True; $Search = True; $View = True; $ViewTable = False; $Form = False; $SearchRecords = True; $PHPValidate = True; $JavaValidate = False; $Navigator = False; $RecsPerPage = 10; $Admin = "root"; $AdminPass = ""; $FK = False; $CSS = "default.css"; $d = True ?> ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- tablelist.php ----------- <?php require("config.php"); print("<table align=center>"); ?> <STYLE> a:hover{color:red;}; </STYLE> <tr><td><a href="index.php">Home</a></td></tr> <?php $Counter = 0; foreach($TableNames as $Table) { ?> <tr><td><a href="main.php?table_id=<?php echo $Counter;?>&Action=Go"><?php echo $Table;?></a></td></tr> <?php $Counter++; }; if($d==true) {_ ?> <tr><td><a href="http://softgalaxy.net/php-mysql/Order.html">order now</a></td></tr> <?php } print("</table>"); ?> Link to comment https://forums.phpfreaks.com/topic/99490-list-tables-fields-on-page/#findComment-509030 Share on other sites More sharing options...
jkkenzie Posted April 4, 2008 Author Share Posted April 4, 2008 any idea? Link to comment https://forums.phpfreaks.com/topic/99490-list-tables-fields-on-page/#findComment-509071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.