间歇性地写入数据库只能部分工作

时间:2012-11-18 01:39:58

标签: php sql database insert vbulletin

我无法重新创建问题,似乎只发生在多台机器上的一个人..

我在想,也许与SQL有关...我不知道他的ISP是否可能与它有关?就像我说的那样,到目前为止的问题只发生在一个人身上..多台机器,多个用户名来测试我的权限代码而且非常奇怪......

另外100次我测试了它,它完美无瑕..这是我的代码的一部分。

if($_REQUEST['do'] == 'save_new_vehicle') {
$userid = $vbulletin->userinfo['userid'];
$username = $vbulletin->userinfo['username'];
$vbulletin->input->clean_array_gpc('p', array(
'year' => TYPE_INT,
'make_model' => TYPE_NOHTML,
'susp_type' => TYPE_NOHTML,
'interior' => TYPE_NOHTML,
'exterior' => TYPE_NOHTML,
'audiovideo' => TYPE_NOHTML,
'wheelstires' => TYPE_NOHTML,
'suspension' => TYPE_NOHTML,
'drivetrain' => TYPE_NOHTML,
'nickname' => TYPE_NOHTML,
));  

$year = $vbulletin->GPC['year'];
$make_model = $vbulletin->GPC['make_model'];
$susp_type = $vbulletin->GPC['susp_type'];
$interior = $vbulletin->GPC['interior'];
$exterior = $vbulletin->GPC['exterior'];
$audio_video = $vbulletin->GPC['audiovideo'];
$wheels_tires = $vbulletin->GPC['wheelstires'];
$suspension = $vbulletin->GPC['suspension'];
$drivetrain = $vbulletin->GPC['drivetrain'];
$nickname = $vbulletin->GPC['nickname'];


$sql = "INSERT INTO ". TABLE_PREFIX ."BAMFG_vehicle (

  userid, 
  username, 
  nickname, 
  year, 
  make_model,
  susp_type,
  exterior,
  interior,
  audio_video,
  drivetrain,
  suspension,
  wheels_tires) VALUES (

  '". $userid ."',
  '". $username ."',
  '". $nickname ."',
  '". $year ."',
  '". $make_model ."',
  '". $susp_type ."',  
  '". $exterior ."',
  '". $interior ."',
  '". $drivetrain ."',
  '". $audio_video ."',
  '". $suspension ."',
  '". $wheels_tires ."')";
$db->query_write($sql);
}

它会写:year,make_model,susp_type,interior,exterior和audio_video ..这个家伙别无其他..

再一次,无数次我试图重新创造一切正常工作的问题,其他人以及一切正常工作。我把头发拉出来了!

您可以自己尝试网站,看看我们是否可以复制结果。 http://www.minitrucker.org/bamfg.php 登录:stackoverflow 密码:密码

在我直接获得所有代码之前,一切都还是粗糙的,没有CSS ..再次感谢。

编辑* 我已将代码更改为:

$year =  mysql_real_escape_string($vbulletin->GPC['year']);
$make_model =  mysql_real_escape_string($vbulletin->GPC['make_model']);
$susp_type =  mysql_real_escape_string($vbulletin->GPC['susp_type']);
$interior =  mysql_real_escape_string($vbulletin->GPC['interior']);
$exterior =  mysql_real_escape_string($vbulletin->GPC['exterior']);
$audio_video =  mysql_real_escape_string($vbulletin->GPC['audiovideo']);
$wheels_tires =  mysql_real_escape_string($vbulletin->GPC['wheelstires']);
$suspension =  mysql_real_escape_string($vbulletin->GPC['suspension']);
$drivetrain =  mysql_real_escape_string($vbulletin->GPC['drivetrain']);
$nickname =  mysql_real_escape_string($vbulletin->GPC['nickname']);

一切仍然适用于我,我将进行更多测试,看看会发生什么。想法?

0 个答案:

没有答案