473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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?
Jul 17 '05 #1
3 1379
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

"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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Chris Reedy | last post by:
For everyone - Apologies for the length of this message. If you don't want to look at the long example, you can skip to the end of the message. And for the Python gurus among you, if you can...
16
by: JustSomeGuy | last post by:
I have a routine that evaluates a polynomial equation that have 3 variables x,y,z of orders 1,2,3 the coefficients of the polynomial are in an array. This routine is quite slow and I'd like to...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
4
by: M O J O | last post by:
Hi, I need a lillte guidance on how to create a simple component and put in in the toolbox. Here's how I've done so far, please let me know if there's a better aproach (I have some question...
12
by: Karina | last post by:
Hello: I am taking over someone else's code and my users are experiencing tons of problems but when I try to go into the source code to edit and try to fix these problems, I realize that all the...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
4
by: Paul David Buchan | last post by:
Hello, I'm attempting to write a program to read in database files (.dbf). When I do it all as a single procedure in main, everything works. However, what I really want, is to pass the database...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.