View Single Post
05-01-2007, 08:58 PM
#3
Dark_Prince11 is offline Dark_Prince11
Status: Member
Join date: Apr 2007
Location: Deer Park, NY
Expertise:
Software:
 
Posts: 123
iTrader: 0 / 0%
 

Dark_Prince11 is on a distinguished road

Send a message via AIM to Dark_Prince11 Send a message via MSN to Dark_Prince11

  Old

This is an entire script basically. I will give a quick rundown.

Code:
<?php
//MySQL Connection
mysql_connect("your host","username","password") or die ('Connect to DB Failed');
mysql_select_db("database name");

//Add A New Row
if($_POST) {
$shopname = $_POST['name'];
$query = mysql_query("INSERT INTO tablename (table_columns)  VALUES ('$shopname',othercolumns)") or die ('Query Failed');
echo 'Added';
}
//Get The Shops
$get = mysql_query("SELECT * FROM tablename ORDER BY id DESC") or die ('Retrieval failed');
?>
<table>
<?php
while ($array = mysql_fetch_array($get)) {?>
<tr>
<td><?=$array['shopname'];?></td>
<?php }?>
</tr>
</table>
<br/>
Add A Shop
<form action="" method="post">
<input type="text">
<input type="submit" value="Add">
</form>
Now that code itself won't work without you replacing the data and is also not that functional since it is only a quick rundown but it gets what you want done...Don't necessarily use this but use it as a base to make your own.... Also, there might be a bug or to since I just typed it up here didn't really test it out but it should work as long as you input everything correctly and fix the HTML tags...