Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listing data that has been input without databases

Status
Not open for further replies.

browniejbb

Technical User
Oct 21, 2002
5
DE
hi, ive just recently started learning php so please go easy on me!
im trying to create a page whereby a visitor can type in their favourite song, say, (this is just an example) and their favourite artist, along with their name and homepage.
Once they have submitted this data, i would like it to come up in a table underneath the form.
i have managed to do this using :


<html>
<head>
<title>musicform
</title>
</head>
<body>
<form action=&quot;musicform.php&quot; method=&quot;POST&quot;>
Your name: <input type=&quot;text&quot; name=&quot;name&quot; />
Your url: <input type=&quot;text&quot; name=&quot;url&quot; />
The song: <input type=&quot;text&quot; name=&quot;song&quot; />
The artist: <input type=&quot;text&quot; name=&quot;artist&quot; />
<input type=&quot;submit&quot; value=&quot;tell me&quot;>
</form>
<br>
<table border=&quot;0&quot;>
<tr>
<th>Name
<th>Url
<th>Song
<th>Artist
</tr>
<tr>
<td><?php echo $_POST[&quot;name&quot;]; ?><br>
</td>
<td><a href=&quot;<?php echo $_POST[&quot;url&quot;]; ?>&quot;><?php echo $_POST[&quot;url&quot;]; ?></a><br>
</td>
<td><?php echo $_POST[&quot;song&quot;]; ?><br>
</td>
<td><?php echo $_POST[&quot;artist&quot;]; ?><br>
</td>
</tr>
<table>
</body>
</html>


however i would like the data then to stay in that table, so that when the next visitor arrives they can input their data into a new row of the table. can i do this without having to create a database?
sorry if that was a long question!
thanks to all : )

 
It can be done without a database, for example by storing the data in a session variable.

I recommend strongly, however, that you do write this as a database app. ______________________________________________________________________
TANSTAAFL!
 
Thank you for the advice : )
would you advise writing such a database in SQL? i know very little about SQL so if the answer is yes do you know of any good tutorials?
thanks again
 
sql is the language for the database...it covers the aspects of data insertion and retreival...you will need to learn some sql to make this go

but in general there are only 4 commands that you would need to use here (insert (put date in DB), select(choose data from db), update (update inserted data) and delete (remove data from db))

try which is the companion site for PHP Essentials by Julie Meloni... or is a good refernce site with lots of good stuff and helpful forums

hth Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top