Article View: es.comp.os.linux.programacion
Article #6746Re: php + mysql
From: Helio.es
Date: Thu, 22 May 2003 15:55
Date: Thu, 22 May 2003 15:55
43 lines
1911 bytes
1911 bytes
Espero no me pegueis si respondo aqu� ;-)
Yo lo har�a as�:
>>> Begin index.php
<html>
<ul>
<?
mysql_connect("localhost", "user", "pass");
$dbs = mysql_query("show databases") or die (mysql_error());
while(list($db) = mysql_fetch_row($dbs)) {
echo "<li><a href='database.php?db=$db'>$db</a></li>";
}
mysql_free_result($dbs);
?>
</ul>
</html>
<<< End index.php
>>> Begin database.php
<html>
<ul>
<?
$db = $HTTP_GET_VARS["db"];
echo "<H1>Database: $db</H1>
mysql_connect("localhost", "user", "pass");
mysql_select_db("$db");
$tables = mysql_query("show tables") or die(mysql_error());
while ($list($table) = mysql_fetch_row($tables)) {
echo "<li><a href='tables.php?db=$db&tbl=$table'>$table</a></li>";
}
mysql_free_result($tables);
?>
</ul>
</html>
<<< End database.php
y el tables.php pues parecido.
Me gustar�a que me lo criticaseis, ya que estamos.
Saludos!
Technical Details
Message-ID:
<bairts$6gg7$1@ID-165255.news.dfncis.de>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!fu-berlin.de!uni-berlin.de!80-25-0-142.uc.nombres.ttd.ES!not-for-mailReferences:
<baigis$jhp$1@rantanplan.linux.es>Show Full Headers
Complete Article Headers
X-Google-Language: PORTUGUESE,ASCII X-Google-Thread: f86c8,2059aec063d979f4 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2003-05-22 08:55:42 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!fu-berlin.de!uni-berlin.de!80-25-0-142.uc.nombres.ttd.ES!not-for-mail From: "Helio.es" <nospam_heltenaNO_S_P_A_N_G@hotmail.com> Newsgroups: es.comp.os.linux.programacion Subject: Re: php + mysql Date: Thu, 22 May 2003 17:55:13 +0200 Lines: 44 Message-ID: <bairts$6gg7$1@ID-165255.news.dfncis.de> References: <baigis$jhp$1@rantanplan.linux.es> NNTP-Posting-Host: 80-25-0-142.uc.nombres.ttd.es (80.25.0.142) Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1053618941 213511 80.25.0.142 (16 [165255]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000