1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| // if there not then insert into db
date_default_timezone_set('Europe/Madrid');
$date_inscription = date('Y-m-d H:i:s');
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$company = "asdasdas";
$phone = "asdasdas";
$phonetwo = "asdasdas";
$address = "asdasdas";
$pass = md5($_POST['pass']);
$description = " asdasdasd ";
$phone = " 0712981289 ";
$email = $_POST['email'];
$req1 = $bdd->prepare('INSERT INTO driver (description) VALUES (:description)');
$req1->execute(array(
'description'=>$description,
));
$last_id = $bdd->lastInsertId();
$req1->closeCursor();
$driver_id = $last_id;
$req2 = $bdd->prepare('
INSERT INTO driver_client_detail (email,pass,date_inscription,first_name,last_name,phone,phonetwo,address,company,driver_id) VALUES (:email,:pass,:date_inscription,:first_name,:last_name,:phone,:phonetwo,:address,:company,:driver_id)
');
/* $req3->execute(array(
'driver_email'=>$driver_email,
'pass'=>$pass,
'date_inscription'=>$date_inscription,
'first_name'=>$first_name,
'last_name'=>$last_name,
'company'=>$company,
'last_id'=>$last_id
));
$req3->closeCursor();*/
$req2->bindParam('email', $email, PDO::PARAM_STR);
$req2->bindParam('pass', $pass, PDO::PARAM_STR);
$req2->bindParam('date_inscription', $date_inscription, PDO::PARAM_STR);
$req2->bindParam('first_name', $first_name, PDO::PARAM_STR);
$req2->bindParam('last_name', $last_name, PDO::PARAM_STR);
$req2->bindParam('phone', $phone, PDO::PARAM_STR);
$req2->bindParam('phonetwo', $phonetwo, PDO::PARAM_STR);
$req2->bindParam('address', $address, PDO::PARAM_STR);
$req2->bindParam('company', $company, PDO::PARAM_STR);
$req2->bindParam('driver_id', $driver_id, PDO::PARAM_INT);
$req2->execute(); |
Partager