Connecting Tech Pros Worldwide Help | Site Map

need help again

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 04:59 AM
Jerry Polyak
Guest
 
Posts: n/a
Default need help again

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, 04:59 AM
Tim Van Wassenhove
Guest
 
Posts: n/a
Default 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, 04:59 AM
Jerry Polyak
Guest
 
Posts: n/a
Default 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, 04:59 AM
Jerry Polyak
Guest
 
Posts: n/a
Default 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?


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.