插入查询不使用uniqid和自动增量

时间:2017-03-27 00:48:42

标签: php

$Control_no = uniqid();

$q = "INSERT INTO `client_t` (`Control_no`, `Client_id`, `Fname`, 
                                `Mname`, `Lname`, `Religion`, 
                                `Citizenship`, `Address`, `E-mail`,
                                `Monthly_Income`, `Detained`, `Date_detained`,
                                `Age`, `Gender`, `Civil_Status`,
                                `Educ_attain`, `Language`, `Contact_no`, 
                                `Spouse`) 
                VALUES ('$Control_no','','$_POST[Fname]',
                        '$_POST[Mname]','$_POST[Religion]','$_POST[Citizenship]',
                        '$_POST[Address]}','$_POST[Email]','$_POST[Monthly_Income]',
                        '$_POST[Detained]','$_POST[Date_Detained]','$_POST[Age]',
                        '$_POST[Gender]','$_POST[Civil_Status]','$_POST[Educ_Attain]',
                        '$_POST[Language]','$_POST[Contact_no]','$_POST[Spouse]')";
$r = mysqli_query($db,$q);
$Client_id = mysqli_insert_id();

0 个答案:

没有答案