数据未更新

时间:2014-04-05 18:55:03

标签: php mysql

当我尝试更新数据时,数据没有更新,它的显示无法始终更新数据,我的会话从我的注册表中携带reg,我想在我的slam表中使用reg更新reg。这两个表中都有reg。

<?php
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST")
{
$con=mysqli_connect("xyz","aaa","aaa","aaa");
if (mysqli_connect_errno($con))
{
   echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$reg =  $_REQUEST["reg"];
$t1 =  $_REQUEST["t"];
$t2 = $_REQUEST['t2'];
$t3 = $_REQUEST['t3'];
$t4 = $_REQUEST['t4'];
$t5 = $_REQUEST['t5'];
$t6 = $_REQUEST['t6'];
$t7 = $_REQUEST['t7'];
$t8 = $_REQUEST['t8'];
$t9 = $_REQUEST['t9'];
$t10 = $_REQUEST['t10'];
$t11 = $_REQUEST['t11'];

$t13 = $_REQUEST['t13'];
$t14 = $_REQUEST['t14'];
$t15 = $_REQUEST['t15'];
$t16 = $_REQUEST['t16'];
$t17 = $_REQUEST['t17'];
$t18 = $_REQUEST['t18'];
$t19 = $_REQUEST['t19'];
$t20 = $_REQUEST['t20'];
$t21 = $_REQUEST['t21'];
$t22 = $_REQUEST['t22'];
$t23 = $_REQUEST['t23'];
$t24 = $_REQUEST['t24'];
$t25 = $_REQUEST['t25'];
$t26 = $_REQUEST['t26'];
$t27 = $_REQUEST['t27'];
$t28 = $_REQUEST['t28'];
$t29 = $_REQUEST['t29'];
$t30 = $_REQUEST['t30'];
$t31 = $_REQUEST['t31'];
$t32 = $_REQUEST['t32'];
$t33 = $_REQUEST['t33'];
$t34 = $_REQUEST['t34'];
$t35 = $_REQUEST['t35'];
$t36 = $_REQUEST['t36'];
$t37 = $_REQUEST['t37'];
$t38 = $_REQUEST['t38'];

$sql="UPDATE slambook SET iam = '$t1' ,pals = '$t2',birthday = '$t3' ,mobile = '$t4' ,zodiac ='$t5' ,address = '$t6',email ='$t7',site = '$t8',id = '$t9' ,hang = '$t10',food = '$t11',colour = '$t13',outfit = '$t14',novel = '$t15',singer = '$t16',song = '$t17',movie = '$t18',actor = '$t19',aim = '$t20',memor = '$t21',you = '$t22',date = '$t23',city = '$t24',frienship = '$t25',nuts = '$t26',besties = '$t27',destiny = '$t28',y = '$t29',moment = '$t30',achieve = '$t31',dream = '$t32',experience = '$t33',imagination = '$t34',regrets = '$t35',stupid = '$t36',belief = '$37',about = '$38' where reg=$reg"; 

$retval = mysqli_query($con,$sql);
if(!$retval )
{
  die('Could not update data: ' . mysql_error());
}


echo "Updated data successfully\n";
mysqli_close($con);
}
else
{
?>

0 个答案:

没有答案