Connecting Tech Pros Worldwide Help | Site Map

need help again

  #1  
Old July 17th, 2005, 05:59 AM
Jerry Polyak
Guest
 
Posts: n/a
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?


  #2  
Old July 17th, 2005, 05:59 AM
Tim Van Wassenhove
Guest
 
Posts: n/a

re: need help again


In article <Xr6dnbW44ZeD9RDdRVn-hw@adelphia.com>, Jerry Polyak wrote:
[color=blue]
> while ($table_num < mysql_num_rows($tables())[/color]

Get yourself a decent editor.

--
http://home.mysth.be/~timvw
  #3  
Old July 17th, 2005, 05:59 AM
Jerry Polyak
Guest
 
Posts: n/a

re: need help again



"Jerry Polyak" <jerrypolyak@NOSPAM_yahoo.com> wrote in message
news:Xr6dnbW44ZeD9RDdRVn-hw@adelphia.com...[color=blue]
> 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?
>
>[/color]

Disregard. Found the extra bracket.


  #4  
Old July 17th, 2005, 05:59 AM
Jerry Polyak
Guest
 
Posts: n/a

re: need help again



"Tim Van Wassenhove" <euki@pi.be> wrote in message
news:c6jpu1$c99pc$1@ID-188825.news.uni-berlin.de...[color=blue]
> In article <Xr6dnbW44ZeD9RDdRVn-hw@adelphia.com>, Jerry Polyak wrote:
>[color=green]
> > while ($table_num < mysql_num_rows($tables())[/color]
>
> Get yourself a decent editor.
>
> --
> http://home.mysth.be/~timvw[/color]

Any recommendations?


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help again!! Crazy Boss is at it again. Marina answers 21 January 29th, 2006 10:25 PM