I'm very new to PHP and trying to create basic webservice. Here is the code
$type_general = $_GET["type_general"];
$name = $_GET["name"];
$firstname = $_GET["firstname"];
$institution = $_GET["institution"];
$institution_name = $_GET["institution_name"];
$street_nr = $_GET["street_nr"];
$city_postal = $_GET["city_postal"];
$email = $_GET["email"];
$telephone = $_GET["telephone"];
$name_firstname_pneumoloog = $_GET["name_firstname_pneumoloog"];
$riziv_pneumoloog = $_GET["riziv_pneumoloog"];
$riziv = $_GET["riziv"];
$type_specialist = $_GET["type_specialist"];
// Add tracking of redemption
// $stmt = $this->db->prepare("INSERT INTO Registration (id,type_general,name,firstname,institution,institution_name,street_nr,city_postal,email,telephone,name_firstname_pneumoloog,riziv_pneumoloog,type_specialist,riziv) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
// $stmt->bind_param("is",NULL, $type_general, $name,$firstname,$institution,$institution_name,$street_nr,$city_postal,$email,$telephone,$name_firstname_pneumoloog,$riziv_pneumoloog,$type_specialist,$riziv);
$stmt = $this->db->prepare("INSERT INTO Registration (type_general,name) VALUES (?,?)");
$stmt->bind_param("is",$type_general,$name);
$stmt->execute();
$stmt->close();
$this->db->commit();
I have the following problems:
- For the parameter
type_general
it always put 0 in my DB - When I try to add all the parameters it doesn't insert anything in my DB
Can anybody please help me with this? Thanks in advance !