Getting various mySQL data to tables?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Xeal
Forum Newbie
Posts: 5
Joined: Thu Jan 29, 2004 1:46 am
Location: Sweden

Getting various mySQL data to tables?

Post by Xeal »

Hi!
I am creating a small webpage that contains an art gallery.
The art gallery consists of a row of 5 tables.

I have been wondering if it is possible for a user to upload a special image and write som info about in html text fields.
This image and textinfo will then be placed automatically in a new table row.

I am quite new into php programming and mysql databases but wonder if this is possible and then how?

Help is much appreciated!
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

Of course this looks possible. Do you have any knowlege of php ? If so give it a start show us some code and someone here will sure help you out!
http://www.hotscripts.com is a very good starting point for tutos and scripts.
Xeal
Forum Newbie
Posts: 5
Joined: Thu Jan 29, 2004 1:46 am
Location: Sweden

Post by Xeal »

Yes I have been writing some. But I have mostly been looking through examples and tutorials :P

Anyway here is some code I wrote so that 5 rows of tables will automatically be generated in the web browser.

<?
function Draw_Table ($row=1,$col=1) {
echo "<table border=\"1\">";
for ($i=1; $i<=$row; $i++) {
echo "<tr>";
for ($j=1; $j<=$col; $j++) {
echo "<td> Row $i, Column $j </td>";
}
echo "</tr>";
}
echo "</table>";
}
?>

<html>
<head>
<title>
Tables in Php
</title>
</head>
<body>

<?
$row = 1;
$col = 5;

Draw_Table($row,$col);
?>
</body>
</html>

So the idea is that information written in html text fields will be automatically inserted into a new row of 5 table datas.
Post Reply