$table_name = 'tbl_users';
$data = array('datetime'=>'NOW()',
'ipadress' => $ipaddress,
'name' => $name,
'dob' => $dob,
'nationality' => $nationality,
'address' => $address,
'city' => $city,
'state' => $state,
'pincode' => $pincode,
'phone' => $phone,
'email' => $email,
'mobile' => $mobile,
'weight' => $weight,
'height'=> $height,
'marital' => $marital,
'degree' => $degree,
'institute' => $institute,
'special' => $special,
'yearofpaas' => $yearofpaas,
'grade' => $grade,
'emplyment_history' => $emplyment_history,
'merits' => $merits,
'major_achivements' => $major_achivements,
'interview_attended' => $interview_attended,
'details' => $details,
'minctc_position' => $minctc_position,
'cv_file' => $cv_file,
'declaration' => $declaration);
echo "<pre>";
print_r($data);
drupal_write_record($table_name, $data);
我有这个插入查询,但不知何故记录不会进入表..任何人都可以帮助我...在查询中是什么问题?????
答案 0 :(得分:1)
你传入NOW()作为一个字符串,这是行不通的。请尝试改为:
$data = array('timestamp' => date("Y-m-d H:i:s"),
答案 1 :(得分:1)
drupal_write_record
才有效。
从here:drupal_write_record根据架构将记录保存(插入或更新)到数据库。
因此,请确保tbl_users
表的架构存在。
另外,如Dan U.
所述,使用date("Y-m-d H:i:s")
代替'Now()'。
答案 2 :(得分:0)
dblog 可以让您对查询中的问题有所了解。路径为 admin / reports / dblog 。