By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,743 Members | 1,780 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,743 IT Pros & Developers. It's quick & easy.

need help again

P: 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?
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <Xr********************@adelphia.com>, Jerry Polyak wrote:
while ($table_num < mysql_num_rows($tables())


Get yourself a decent editor.

--
http://home.mysth.be/~timvw
Jul 17 '05 #2

P: n/a

"Jerry Polyak" <jerrypolyak@NOSPAM_yahoo.com> wrote in message
news:Xr********************@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.
Jul 17 '05 #3

P: n/a

"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:c6************@ID-188825.news.uni-berlin.de...
In article <Xr********************@adelphia.com>, Jerry Polyak wrote:
while ($table_num < mysql_num_rows($tables())


Get yourself a decent editor.

--
http://home.mysth.be/~timvw


Any recommendations?
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.