|
|||||||
New to SitePoint Forums? Register here for free!
|
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2006
Location: UK (SWANSEA)
Posts: 655
|
how do i do this?
iv got this far with a bit of help from you guys but am stuck again
![]() what im trying to do is be able to select which table the user wants to edit the fields for iv managed to get a list off all the data in each table but now im stuck on how to bring up a page with all the data in that field in it? understand? this is the code for displaying the list of items in each table. how would i be able to show the content of that field? Code:
else if (isset($_GET['edit'])) {
?>
<form action="" method=post enctype=multipart/form-data>
<p>Select the product range you want to edit<br>
<input type=radio name=table value=clarice checked=checked> Clarice Cliff<br />
<input type=radio name=table value=welsh> Welsh Gaudy<br />
<input type=radio name=table value=deco> Deco Antique<br />
<input type=radio name=table value=royal> Royal Doulton<br />
<input type=Submit name="submit" value=Edit>
<?php
if ($_POST['submit']) {
$source=$_POST['table'];
include ("dbconnect.php");
$sql="SELECT * FROM " . mysql_real_escape_string($_POST['table']);
$result=mysql_query($sql) or die(mysql_error());
?>
<table width=293 border=1>
<tr>
<td width=171>Product Name</td>
<td width=106>Update</td>
</tr>
<tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<td><?php echo $rows['name']; ?></td>
<td align="center"><a href="index.php?id=<? echo $rows['id']; ?>">update</a></td>
</tr>
<?php
}
?>
</table>
<?php
mysql_close();
}
}
|
|
|
|
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 03:16.










Threaded Mode