Answer the question
In order to leave comments, you need to log in
Why doesn't Update work?
<?
session_start();
require 'connect.php';
if(isset($_POST['name'])){
$name=$_POST['name'];
$email=$_POST['email'];
$tel=$_POST['tel'];
$date5=$_POST['date5'];
$id=$_POST['id'];
$insert_sql2 = ("UPDATE `visits` SET `name`= '{$name}' WHERE `login` = '{$_SESSION['login']}' AND id = '$login'") or die(mysql_error());
mysql_query($insert_sql2);
}
if ($insert_sql2){echo "<center><table width=50% bgcolor=#00aff0><tr><td><center><font color=#ffffff>Информация сохранилась</font></center></td></tr></table></center><br><br>";}
$login = $_REQUEST['user2'];
$result=mysql_query("SELECT * FROM `visits` WHERE login = '{$_SESSION['login']}' AND id = '$login'") or die(mysql_error());
while($row=mysql_fetch_array($result))
echo '<form action="" method=post enctype="multipart/form-data" ><table width=90%>
<tr>
<td>имя</td>
<td><input type=text name=name value="' . $row['name'] . '"></td>
</tr>
<tr>
<td>email</td>
<td><input type=text name=key2 value="' . $row['email'] . '"></td>
</tr>
</table><br><br>
<input type=submit value=Сохранить class=button10><br>
</form><br><br>';
?>
Answer the question
In order to leave comments, you need to log in
Ummm...
Maybe because you don't send a request?
And MySQL is already deprecated and removed in PHP 7.0.0+
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question