- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
<?
mysql_connect("$db_host", "$db_user", "$db_pass") or die(mysql_error());
mysql_selectdb($db) or die(mysql_error());
$q = "SELECT `login`, `email`, `name`, `second_name`, `age` FROM $db.accounts WHERE login='".$_SESSION['login']."' ";
$res = mysql_query($q) or die(mysql_error());
$row=mysql_fetch_array($res);?>
...
<?
$name = $_POST['name'];
$email = $_POST['email'];
$log = $_SESSION['name'];
$second_name = $_POST['second_name'];
$age = $_POST['age'];
mysql_connect("$db_host", "$db_user", "$db_pass") or die(mysql_error());
mysql_selectdb($db) or die(mysql_error());
$query = "UPDATE accounts SET name ='$name', second_name='$second_name', email='$email', age='$age' WHERE login = '$log'";
mysql_query($query) or die(mysql_error());
?>