Hellow peoplw. I have an update syntax that is doing something else than I expect.
I want to update a table with price of the products for a selected user the form is ok but when I click update the order update only the last price inserted.Why?
p>
Here you can update your account information for viewing in your
profile.<br><br>
<?php
if (isset($_POST['submit']) &&
$_POST['submit'] == "Update") {
$query_update = "UPDATE preturi,user_info SET
Pret_manopera = '" . $_POST['email'] . "'
WHERE username = '" . $_SESSION['user_logged'] . "'
AND password = '" . $_SESSION['user_password'] ."'
AND user_info.user_id=preturi.id_ofertant
";
$result_update = mysql_query($query_update)
or die(mysql_error());
$query1 = "SELECT * FROM preturi,user_info
WHERE username = '" . $_SESSION['user_logged'] . "'
AND password = '" . $_SESSION['user_password'] . "'
AND user_info.user_id=preturi.id_ofertant
";
$result1 = mysql_query($query1)
or die(mysql_error());
$row = mysql_fetch_array($result1);
?>
<b>Informatiile din contul tau au fost modificate.</b><br>
<a href="user_personal.php">Apasa aici</a>pentru a te intoarce in contul tau.
</p>
<?php
}else{
$query = "SELECT * FROM user_info,preturi
WHERE username = '" . $_SESSION['user_logged']."'
AND password ='".$_SESSION['user_password'] ."'
AND user_info.user_id=preturi.id_ofertant";
$result = mysql_query($query)
or die(mysql_error());
while ($row = mysql_fetch_array($result)){
?>
"<p>
<form action="updatepreturi2.php" method="post">
<?php echo $row['id_manopera'];?>": <input type="text" name="email"
size="2" value="<?php echo $row['Pret_manopera'];}}?>"><br>
<input type="submit" name="submit" value="Update">
<input type="button" value="Cancel" onclick="history.go(-1);">
</form>
It must be a lot of briliant brains around here that think faster than me.
Thank you !