You can check below steps -
- Check for errors after executing the statement.
- Bind parameters to placeholders in the SQL query.
- Confirm that the data being inserted matches the format expected by the database table.
$data = array('project_number' => '2222', 'project_name' => 'New Project');
$stmt = $db->prepare("INSERT INTO table_name (project_number, project_name) VALUES (?, ?)");
if ($stmt && $stmt->bind_param('ss', $data['project_number'], $data['project_name']) && $stmt->execute()) {
echo "Data inserted successfully!";
} else {
echo "Error executing the statement: " . $db->error;
}
Replace 'table_name' with your actual table name, and adjust the data array keys to match your table's column names.
Hope it helps !
Thank you
nolanmaris
Einen Kommentar schreiben: