Hi,
Hope someone can help me with some code for editing data that I retrieve from a database. I am a newbie so please bear with me. Below is the code I used for retrieving data from a database, the data is sent from a form I have set up (basic stuff I guess) what I now want to do is be able to retrieve the data for viewing and editing, how can I do this?
<html>
<head>
<title>IED Group Quote List</title>
<body>
<?php
//Set the variables for the database access:
$Host="localhost";
$User="xxxxxx";
$Password="xxxxxxx";
$DBName="xxxxxxx";
$TableName="xxxxxxx";
$Link=mysql_connect($Host,$User,$Password);
$Query="SELECT*from $TableName";
$Result=mysql_db_query ($DBName, $Query, $Link);
//Create a table.
print ("<TABLE BORDER=1 WIDTH=\"90%\" CELLSPACING=2 CELLPADDING=2 bgcolor=#D0D0D0 ALIGN=CENTER>\n");
print ("<TR ALIGN=CENTER bgcolor=#000000 VALIGN=TOP>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP><FONT COLOR=WHITE><b>Date</TD>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP><FONT COLOR=WHITE><b>Customer</TD>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP><FONT COLOR=WHITE><b>PartNumber</TD>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP><FONT COLOR=WHITE><b>Qty</TD>\n");
print ("</TR>\n");
//Fetch the results from the database.
while($Row=mysql_fetch_array($Result)){
print ("<TR ALIGN=CENTER VALIGN=TOP>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP>$Row[Date]</TD>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP>$Row[Customer]</TD>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP>$Row[PartNumber]</TD>\n");
print ("<TD ALIGN=CENTER VALIGN=TOP>$Row[Qty]</TD>\n");
print ("</TR>\n");
}
mysql_close($Link);
print("<TABLE>\n");
?>.
</BODY>
</HTML>