Hi,
I am having problems in updating data in mysql. I have tried to update only the "prise" under products but with no luck. I am missing the plot here.
I tried to echo the prise value to see what actually is in it but that also comes up empty. Once i click on the update button my web page is refreshed with the old data.
Please help
Kind Regards
Warren
Language: PHP
<?php
//error_reporting(0);
include ("connect.php");
$id=$_GET[';prod_id';];
$query = "SELECT * FROM PRODUCT WHERE prod_id=';$id';"; // read data from user table and sort by prod_id
or
die("Query failed: " . mysql_error()); //Check if connect in has been made and that database ex
{
$prod_id=$row[';prod_id';];
$prod_name=$row[';prod_name';];
$prod_desc=$row[';prod_desc';];
$prise=$row[';prise';];
echo "<form method=';POST';>";
echo "Product ID :";
echo "<td>","<input type=\"text\" name=\"prod_desc\" value=\"$prod_id\">","</td>";
echo "<tr>","<td>","Product Name :","</td>";
echo "<td>","<input type=\"text\" name=\"prod_name\" value=\"$prod_name\">","</td>";
echo "<tr>","<td>","Description :","</td>","<td>","<input type=\"text\" name=\"prod_desc\" value=\"$prod_desc\">","</td>";
echo "<tr>","<td>","Prise : ","</td>","<td>","<input type=\"text\" name=\"prise\" value=\"$prise\">","</td>";
echo "<td>","<div align=';center';><input type=';submit'; name=';submit'; value=';Submit'; /></div></td></form>";
echo "</table>";
if(isset($_POST[';submit';])) {
$sql = ("UPDATE product SET prise=';$prise'; WHERE prod_id=';$prod_id'; ");
//header(';location:test.php';);
}
}
?>