Home > Archive > PHP Programming > April 2004 > need help again
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Jerry Polyak 2004-04-27, 12:45 am |
| My code is as follows:
<?
$connection = @mysql_connect("localhost", "jerry", "") or
die(mysql_error());
$dbs = @mysql_list_dbs($connection) or die(mysql_error());
$db_list = "<ul>";
$db_num = 0;
while ($db_num < mysql_num_rows($dbs)) {
$db_names[$db_num] = mysql_tablename($dbs, $db_num);
$db_list .= "<li>$db_names[$db_num]";
// get table names and start another bullet list
$tables = @mysql_list_tables($db_names[$db_num]) or die (mysql_error());
$table_list = "<ul>";
$table_num = 0;
//loop through the results of function
while ($table_num < mysql_num_rows($tables())
{
$table_names[$table_num] = mysql_tablename($tables, $table_num);
$table_list .= "<li>$table_names[$table_num]";
$table_num++;
}
$table_list .= "</ul>";
$db_list .= "$table_list";
$db_num++;
}
$db_list .= "</ul>";
?>
<html>
<head>
<title>My SQL Tables</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p><strong>Databases and tables on localhost</strong>:</p>
<? echo "$db_list"; ?>
</body>
</html>
I get an error:
Parse error: parse error, unexpected '{' in c:\program files\apache
group\apache\htdocs\tmp1fagswsn1y.php on line 19
Yet I see no reason for it. The bracket does belong there. <?>
What am I missing?
| |
| Tim Van Wassenhove 2004-04-27, 12:45 am |
| In article <Xr6dnbW44ZeD9RDdRVn-hw@adelphia.com>, Jerry Polyak wrote:
> while ($table_num < mysql_num_rows($tables())
Get yourself a decent editor.
--
http://home.mysth.be/~timvw
| |
| Jerry Polyak 2004-04-27, 12:45 am |
|
"Jerry Polyak" <jerrypolyak@NOSPAM_yahoo.com> wrote in message
news:Xr6dnbW44ZeD9RDdRVn-hw@adelphia.com...
> My code is as follows:
>
> <?
> $connection = @mysql_connect("localhost", "jerry", "") or
> die(mysql_error());
>
> $dbs = @mysql_list_dbs($connection) or die(mysql_error());
>
> $db_list = "<ul>";
>
> $db_num = 0;
>
> while ($db_num < mysql_num_rows($dbs)) {
> $db_names[$db_num] = mysql_tablename($dbs, $db_num);
> $db_list .= "<li>$db_names[$db_num]";
> // get table names and start another bullet list
> $tables = @mysql_list_tables($db_names[$db_num]) or die (mysql_error());
> $table_list = "<ul>";
> $table_num = 0;
> //loop through the results of function
> while ($table_num < mysql_num_rows($tables())
> {
> $table_names[$table_num] = mysql_tablename($tables, $table_num);
> $table_list .= "<li>$table_names[$table_num]";
> $table_num++;
> }
> $table_list .= "</ul>";
> $db_list .= "$table_list";
> $db_num++;
> }
> $db_list .= "</ul>";
> ?>
>
> <html>
> <head>
> <title>My SQL Tables</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
>
> <body>
> <p><strong>Databases and tables on localhost</strong>:</p>
>
> <? echo "$db_list"; ?>
> </body>
> </html>
>
> I get an error:
> Parse error: parse error, unexpected '{' in c:\program files\apache
> group\apache\htdocs\tmp1fagswsn1y.php on line 19
>
> Yet I see no reason for it. The bracket does belong there. <?>
>
> What am I missing?
>
>
Disregard. Found the extra bracket.
| |
| Jerry Polyak 2004-04-27, 12:45 am |
|
"Tim Van Wassenhove" <euki@pi.be> wrote in message
news:c6jpu1$c99pc$1@ID-188825.news.uni-berlin.de...
> In article <Xr6dnbW44ZeD9RDdRVn-hw@adelphia.com>, Jerry Polyak wrote:
>
>
> Get yourself a decent editor.
>
> --
> http://home.mysth.be/~timvw
Any recommendations?
|
|
|
|
|