🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #6686

Re: php + mysql

#6686
From: Matias Ortega
Date: Mon, 26 May 2003 07:56
55 lines
2456 bytes
Pues he hecho una peque�a prueba y el database.php da error. No lo he 
mirado, simplemente ha sido una pruebilla.
El error esta aqui (segun el apache):

while ($list($table) = mysql_fetch_row($tables)) {

Helio.es(e)k dio:
> 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: <basham$p27$1@rantanplan.linux.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!cox.net!news-xfer.cox.net!mainake.escomposlinux.org!not-for-mail
References: <baigis$jhp$1@rantanplan.linux.es> <bairts$6gg7$1@ID-165255.news.dfncis.de>

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-26 00:56:08 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!cox.net!news-xfer.cox.net!mainake.escomposlinux.org!not-for-mail
From: Matias Ortega <mortega@QUITARaulabus.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: php + mysql
Date: Mon, 26 May 2003 09:56:37 +0200
Organization: Ecolnet
Lines: 56
Message-ID: <basham$p27$1@rantanplan.linux.es>
References: <baigis$jhp$1@rantanplan.linux.es> <bairts$6gg7$1@ID-165255.news.dfncis.de>
NNTP-Posting-Host: 208.red-80-38-244.pooles.rima-tde.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: rantanplan.linux.es 1053935766 25671 80.38.244.208 (26 May 2003 07:56:06 GMT)
X-Complaints-To: mainake@escomposlinux.org
NNTP-Posting-Date: Mon, 26 May 2003 07:56:06 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; eu-ES; rv:1.3) Gecko/20030506 Debian/1.3-5.he-1
X-Accept-Language: es
In-Reply-To: <bairts$6gg7$1@ID-165255.news.dfncis.de>