[ask]SELECT * FROM product WHERE id=' '???
Posted: Mon Mar 08, 2010 9:18 am
I got this page...

This the code...
view_product.php
edit_product.php
What i wanna do is,
when i click on "Edit" then open page "view_product.php",
but the ID from the page before still carry on,
so the content of page "edit_product.php" is based on id from database...
as far as i know, i have to put something here...
but now im stuck,
please i really need help,
thanks..

This the code...
view_product.php
Code: Select all
<?
include "../conf.php";
$view = mysql_query("SELECT * FROM product ORDER BY id ASC");
echo ("
<table width=\"100%\" id=\"head\">
<tr>
<td width=\"\">#</td>
<td width=\"5%\"><b>id</b></td>
<td width=\"20%\"><b>name</b></td>
<td width=\"25%\"><b>price</b></td>
<td width=\"25%\"><b>manufacture</b></td>
<td width=\"20%\"><b>size</b></td>
<td width=\"5%\"><b>order</b></td>
</tr>
</table>
");
while ($result = mysql_fetch_array($view))
{
echo ("
<a href=\"#\" class=\"des\">
<table width=\"100%\" id=\"list\">
<tr id=\"field\">
<td width=\"\"><input type=checkbox name=del[] id=del value=$result[id]></td>
<td width=\"5%\">$result[id]</td>
<td width=\"20%\">$result[name]</td>
<td width=\"25%\">$result[price]</td>
<td width=\"25%\">$result[manufac]</td>
<td width=\"20%\">$result[size]</td>
<td width=\"5%\"><a href=\"edit_product2.php\">Edit</a></td>
</tr>
</table>
</a>
");
}
?>Code: Select all
<?
include "../conf.php";
$view = mysql_query("SELECT * FROM product WHERE id=' ' ");
echo ("
<pre>
Name : $view[name]
Price : $view[price]
Manufacture : $view[manuf]
Size : $view[size]
</pre>
");
?>when i click on "Edit" then open page "view_product.php",
but the ID from the page before still carry on,
so the content of page "edit_product.php" is based on id from database...
as far as i know, i have to put something here...
("SELECT * FROM product WHERE id=' ' ")
but now im stuck,
please i really need help,
thanks..