Page 1 of 1
Re: issue with inserting data that has hyphen in
Posted: Fri Jan 15, 2016 1:48 pm
by Celauran
Nothing's jumping out at me
can't seem to insert the data
Can you elaborate? Are you getting any errors?
Re: issue with inserting data that has hyphen in
Posted: Fri Jan 15, 2016 2:36 pm
by Celauran
Have you checked the return value of $stmt->execute? Called $mysqli->error?
Re: issue with inserting data that has hyphen in
Posted: Fri Jan 15, 2016 2:48 pm
by Celauran
ianhaney wrote:Not yet no, how do I do that?
For debugging, this will do
Code: Select all
// insert the new record into the database
if ($stmt = $mysqli->prepare("INSERT software (software_title, software_number, times_used, customers_name) VALUES (?, ?, ?)"))
{
$stmt->bind_param("ssss", $software_title, $software_number, $times_used, $customers_name);
$success = $stmt->execute();
if ($success === false) {
var_dump($mysqli->error); exit;
}
$stmt->close();
}
You'll want to implement some proper error checking and handling but, for now, this will let us get to the bottom of the current issue.
Re: issue with inserting data that has hyphen in
Posted: Fri Jan 15, 2016 3:07 pm
by Celauran
I noticed INTO keyword is absent. INSERT INTO software...
Re: issue with inserting data that has hyphen in
Posted: Sun Jan 17, 2016 1:16 am
by Weirdan
Has that solved your problem?
Re: issue with inserting data that has hyphen in
Posted: Sun Jan 17, 2016 12:11 pm
by Weirdan
Great!