whatsapp based wizard cannot update correct fields
I have a wizard that collects information using whatsapp api which in beta according to the twilio docs. I can get it to send and receive information from users. I now want to use it to fill up appropriate fields in a mysql table called travel but i dont understand why it cannot fill up the fields appropriately. Here is the script that i am using
$twilio = new Client($sid, $token);
$number = $_POST['From'];
$body = $_POST['Body'];
$servername = "localhost";
$username = "root";
$password = "123456";
$dbname = "twilio";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$query = "select * from travel where telephone_number = '$number' AND msg = 'UNDONE'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$rc = $result->num_rows;
$t = time();
$telephone_number = $row['telephone_number'];
$q1_field = $row['where_are_u_travelling_to'];
$q2_field = $row['where_are_you_travelling_from'];
$q3_field = $row['are_you_ready_to_go_on_next_bus'];
$q4_field = $row['how_many_people'];
$msg = $row['msg'];
if($rc == 0){
$sql = "INSERT INTO travel (telephone_number,last_updated,msg)
VALUES ('$number','$t','UNDONE')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Welcome To The Booking System.Where are you travellig to?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
}
//First
if(empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_01 = "UPDATE travel SET
where_are_u_travelling_to='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_01) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Where are you travelling from?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Second
if(!empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_02 = "UPDATE travel SET
where_are_u_travelling_from='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_02) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Are you ready to go on the next bus?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Third
if(!empty($q1_field) && !empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_03 = "UPDATE travel SET
are_you_ready_to_go_on_next_bus='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_03) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "How many people are travelling?.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Fourth
if(!empty($q1_field) && !empty($q2_field) && !empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_04 = "UPDATE travel SET
how_many_people='$body',
last_updated='$t',msg='DONE'
WHERE telephone_number='$number'";
if ($conn->query($sql_04) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Thank you for travelling with us.Yur ticket has been booked.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
This is the mysql schema
CREATE TABLE `travel` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`telephone_number` VARCHAR(50) NULL DEFAULT NULL,
`where_are_u_travelling_to` VARCHAR(50) NULL DEFAULT NULL,
`where_are_you_travelling_from` VARCHAR(50) NULL DEFAULT NULL,
`are_you_ready_to_go_on_next_bus` VARCHAR(50) NULL DEFAULT NULL,
`how_many_people` VARCHAR(50) NULL DEFAULT NULL,
`msg` VARCHAR(50) NULL DEFAULT NULL,
`last_updated` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
AUTO_INCREMENT=1
;
Only the very first update keeps updating and not other fields.Why is this?.
php whatsapi
add a comment |
I have a wizard that collects information using whatsapp api which in beta according to the twilio docs. I can get it to send and receive information from users. I now want to use it to fill up appropriate fields in a mysql table called travel but i dont understand why it cannot fill up the fields appropriately. Here is the script that i am using
$twilio = new Client($sid, $token);
$number = $_POST['From'];
$body = $_POST['Body'];
$servername = "localhost";
$username = "root";
$password = "123456";
$dbname = "twilio";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$query = "select * from travel where telephone_number = '$number' AND msg = 'UNDONE'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$rc = $result->num_rows;
$t = time();
$telephone_number = $row['telephone_number'];
$q1_field = $row['where_are_u_travelling_to'];
$q2_field = $row['where_are_you_travelling_from'];
$q3_field = $row['are_you_ready_to_go_on_next_bus'];
$q4_field = $row['how_many_people'];
$msg = $row['msg'];
if($rc == 0){
$sql = "INSERT INTO travel (telephone_number,last_updated,msg)
VALUES ('$number','$t','UNDONE')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Welcome To The Booking System.Where are you travellig to?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
}
//First
if(empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_01 = "UPDATE travel SET
where_are_u_travelling_to='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_01) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Where are you travelling from?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Second
if(!empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_02 = "UPDATE travel SET
where_are_u_travelling_from='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_02) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Are you ready to go on the next bus?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Third
if(!empty($q1_field) && !empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_03 = "UPDATE travel SET
are_you_ready_to_go_on_next_bus='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_03) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "How many people are travelling?.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Fourth
if(!empty($q1_field) && !empty($q2_field) && !empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_04 = "UPDATE travel SET
how_many_people='$body',
last_updated='$t',msg='DONE'
WHERE telephone_number='$number'";
if ($conn->query($sql_04) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Thank you for travelling with us.Yur ticket has been booked.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
This is the mysql schema
CREATE TABLE `travel` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`telephone_number` VARCHAR(50) NULL DEFAULT NULL,
`where_are_u_travelling_to` VARCHAR(50) NULL DEFAULT NULL,
`where_are_you_travelling_from` VARCHAR(50) NULL DEFAULT NULL,
`are_you_ready_to_go_on_next_bus` VARCHAR(50) NULL DEFAULT NULL,
`how_many_people` VARCHAR(50) NULL DEFAULT NULL,
`msg` VARCHAR(50) NULL DEFAULT NULL,
`last_updated` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
AUTO_INCREMENT=1
;
Only the very first update keeps updating and not other fields.Why is this?.
php whatsapi
Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either theMYSQLI_orPDOAPI's
– RiggsFolly
Nov 14 '18 at 10:56
Some sensible code indentation would be a good idea. It helps us read the code and more importantly it will help you debug your code Take a quick look at a coding standard for your own benefit. You may be asked to amend this code in a few weeks/months and you will thank me in the end.
– RiggsFolly
Nov 14 '18 at 10:57
add a comment |
I have a wizard that collects information using whatsapp api which in beta according to the twilio docs. I can get it to send and receive information from users. I now want to use it to fill up appropriate fields in a mysql table called travel but i dont understand why it cannot fill up the fields appropriately. Here is the script that i am using
$twilio = new Client($sid, $token);
$number = $_POST['From'];
$body = $_POST['Body'];
$servername = "localhost";
$username = "root";
$password = "123456";
$dbname = "twilio";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$query = "select * from travel where telephone_number = '$number' AND msg = 'UNDONE'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$rc = $result->num_rows;
$t = time();
$telephone_number = $row['telephone_number'];
$q1_field = $row['where_are_u_travelling_to'];
$q2_field = $row['where_are_you_travelling_from'];
$q3_field = $row['are_you_ready_to_go_on_next_bus'];
$q4_field = $row['how_many_people'];
$msg = $row['msg'];
if($rc == 0){
$sql = "INSERT INTO travel (telephone_number,last_updated,msg)
VALUES ('$number','$t','UNDONE')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Welcome To The Booking System.Where are you travellig to?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
}
//First
if(empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_01 = "UPDATE travel SET
where_are_u_travelling_to='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_01) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Where are you travelling from?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Second
if(!empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_02 = "UPDATE travel SET
where_are_u_travelling_from='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_02) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Are you ready to go on the next bus?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Third
if(!empty($q1_field) && !empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_03 = "UPDATE travel SET
are_you_ready_to_go_on_next_bus='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_03) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "How many people are travelling?.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Fourth
if(!empty($q1_field) && !empty($q2_field) && !empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_04 = "UPDATE travel SET
how_many_people='$body',
last_updated='$t',msg='DONE'
WHERE telephone_number='$number'";
if ($conn->query($sql_04) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Thank you for travelling with us.Yur ticket has been booked.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
This is the mysql schema
CREATE TABLE `travel` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`telephone_number` VARCHAR(50) NULL DEFAULT NULL,
`where_are_u_travelling_to` VARCHAR(50) NULL DEFAULT NULL,
`where_are_you_travelling_from` VARCHAR(50) NULL DEFAULT NULL,
`are_you_ready_to_go_on_next_bus` VARCHAR(50) NULL DEFAULT NULL,
`how_many_people` VARCHAR(50) NULL DEFAULT NULL,
`msg` VARCHAR(50) NULL DEFAULT NULL,
`last_updated` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
AUTO_INCREMENT=1
;
Only the very first update keeps updating and not other fields.Why is this?.
php whatsapi
I have a wizard that collects information using whatsapp api which in beta according to the twilio docs. I can get it to send and receive information from users. I now want to use it to fill up appropriate fields in a mysql table called travel but i dont understand why it cannot fill up the fields appropriately. Here is the script that i am using
$twilio = new Client($sid, $token);
$number = $_POST['From'];
$body = $_POST['Body'];
$servername = "localhost";
$username = "root";
$password = "123456";
$dbname = "twilio";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$query = "select * from travel where telephone_number = '$number' AND msg = 'UNDONE'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$rc = $result->num_rows;
$t = time();
$telephone_number = $row['telephone_number'];
$q1_field = $row['where_are_u_travelling_to'];
$q2_field = $row['where_are_you_travelling_from'];
$q3_field = $row['are_you_ready_to_go_on_next_bus'];
$q4_field = $row['how_many_people'];
$msg = $row['msg'];
if($rc == 0){
$sql = "INSERT INTO travel (telephone_number,last_updated,msg)
VALUES ('$number','$t','UNDONE')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Welcome To The Booking System.Where are you travellig to?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
}
//First
if(empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_01 = "UPDATE travel SET
where_are_u_travelling_to='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_01) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Where are you travelling from?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Second
if(!empty($q1_field) && empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_02 = "UPDATE travel SET
where_are_u_travelling_from='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_02) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Are you ready to go on the next bus?",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Third
if(!empty($q1_field) && !empty($q2_field) && empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_03 = "UPDATE travel SET
are_you_ready_to_go_on_next_bus='$body',
last_updated='$t'
WHERE telephone_number='$number'";
if ($conn->query($sql_03) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "How many people are travelling?.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
//Fourth
if(!empty($q1_field) && !empty($q2_field) && !empty($q3_field) && empty($q4_field) && $msg == "UNDONE"){
$sql_04 = "UPDATE travel SET
how_many_people='$body',
last_updated='$t',msg='DONE'
WHERE telephone_number='$number'";
if ($conn->query($sql_04) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$message = $twilio->messages
->create("$number",
array(
"body" => "Thank you for travelling with us.Yur ticket has been booked.",
"from" => "whatsapp:+14"
)
);
print($message->sid);
exit();
}
This is the mysql schema
CREATE TABLE `travel` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`telephone_number` VARCHAR(50) NULL DEFAULT NULL,
`where_are_u_travelling_to` VARCHAR(50) NULL DEFAULT NULL,
`where_are_you_travelling_from` VARCHAR(50) NULL DEFAULT NULL,
`are_you_ready_to_go_on_next_bus` VARCHAR(50) NULL DEFAULT NULL,
`how_many_people` VARCHAR(50) NULL DEFAULT NULL,
`msg` VARCHAR(50) NULL DEFAULT NULL,
`last_updated` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
AUTO_INCREMENT=1
;
Only the very first update keeps updating and not other fields.Why is this?.
php whatsapi
php whatsapi
edited Nov 14 '18 at 10:59
RiggsFolly
70.5k1864111
70.5k1864111
asked Nov 14 '18 at 10:51
GandalfGandalf
5,5252269122
5,5252269122
Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either theMYSQLI_orPDOAPI's
– RiggsFolly
Nov 14 '18 at 10:56
Some sensible code indentation would be a good idea. It helps us read the code and more importantly it will help you debug your code Take a quick look at a coding standard for your own benefit. You may be asked to amend this code in a few weeks/months and you will thank me in the end.
– RiggsFolly
Nov 14 '18 at 10:57
add a comment |
Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either theMYSQLI_orPDOAPI's
– RiggsFolly
Nov 14 '18 at 10:56
Some sensible code indentation would be a good idea. It helps us read the code and more importantly it will help you debug your code Take a quick look at a coding standard for your own benefit. You may be asked to amend this code in a few weeks/months and you will thank me in the end.
– RiggsFolly
Nov 14 '18 at 10:57
Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the
MYSQLI_ or PDO API's– RiggsFolly
Nov 14 '18 at 10:56
Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the
MYSQLI_ or PDO API's– RiggsFolly
Nov 14 '18 at 10:56
Some sensible code indentation would be a good idea. It helps us read the code and more importantly it will help you debug your code Take a quick look at a coding standard for your own benefit. You may be asked to amend this code in a few weeks/months and you will thank me in the end.
– RiggsFolly
Nov 14 '18 at 10:57
Some sensible code indentation would be a good idea. It helps us read the code and more importantly it will help you debug your code Take a quick look at a coding standard for your own benefit. You may be asked to amend this code in a few weeks/months and you will thank me in the end.
– RiggsFolly
Nov 14 '18 at 10:57
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298459%2fwhatsapp-based-wizard-cannot-update-correct-fields%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298459%2fwhatsapp-based-wizard-cannot-update-correct-fields%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the
MYSQLI_orPDOAPI's– RiggsFolly
Nov 14 '18 at 10:56
Some sensible code indentation would be a good idea. It helps us read the code and more importantly it will help you debug your code Take a quick look at a coding standard for your own benefit. You may be asked to amend this code in a few weeks/months and you will thank me in the end.
– RiggsFolly
Nov 14 '18 at 10:57