我在数据库表 pets 中得到 0,其中 pet_id 应更新为登录用户 id
任何想法请我认为这很简单,但我不确定。
<?php require 'database.php';
session_start();
$id = $_SESSION['user_id'];
$_SESSION['user_id']= $id;
$_SESSION['user_name'] = $full_name;
$_SESSION['user_level'] = $user_level;
$_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);
$_SESSION['session_name'] = $user_name;
$_SESSION['balance']= $balance;
$value = 1050;
$user_id = mysql_insert_id($link);
$sql_insert1 = "INSERT into `pets`
(`pet_id`,`value`)
VALUES
('.$id','$value')";
mysql_query($sql_insert1,$link) or die("Failed" . mysql_error());
?>