Here's the code that I have the puts the information into the database
<?php
include 'config_ada.php';
/*** create a new mysqli object with default database***/
$connection = mysqli_connect($hostname, $username, $password, $dbname) or die ("Unable to connect");
/*** sql to UPDATE a new record ***/
$sql = "INSERT INTO ada set
(job_name, job_number, owner, own_phone, own_address, phone, proj_loc,
proj_type, proj_desc, start_date, finish_date, square_feet, total_hours,
total_fee, est_cost, act_cost, change_ord, consultants, contractor, file_box_num,
file_box_loc, drawing_box_num, cad_cd, contract, Field25, Field26, Field27,
Field28, proj_manager, proj_arch)
values
('$_POST[job_name]', '$_POST[job_number]', '$_POST[owner]', '$_POST[own_phone]',
'$_POST[own_address]', '$_POST[phone]', '$_POST[proj_loc]', '$_POST[proj_type]',
'$_POST[proj_desc]', '$_POST[start_date]', '$_POST[finish_date]', '$_POST[square_feet]',
'$_POST[total_hours]', '$_POST[total_fee]', '$_POST[est_cost]', '$_POST[act_cost]',
'$_POST[change_ord]', '$_POST[consultants]', '$_POST[contractor]', '$_POST[file_box_num]',
'$_POST[file_box_loc]', '$_POST[drawing_box_num]', '$_POST[cad_cd]', '$_POST[contract]',
'$_POST[field25]', '$_POST[field26]', '$_POST[field27]', '$_POST[field28]',
'$_POST[proj_manager]', '$_POST[proj_arch]')";
//excute query
$result = mysqli_query($connection, $sql) or die ("Error in query: $sql. ".mysqli_error());
// close connection
mysqli_close($connection);
header("Location: view_project_25.php");
exit;
?>
and here the error that I'm getting after it runs.
Warning: mysqli_error() expects exactly 1 parameter, 0 given in c:\Inetpub\wwwroot\ada\add_project.php on line 26
Error in query: INSERT INTO ada set (job_name, job_number, owner, own_phone, own_address, phone, proj_loc, proj_type, proj_desc, start_date, finish_date, square_feet, total_hours, total_fee, est_cost, act_cost, change_ord, consultants, contractor, file_box_num, file_box_loc, drawing_box_num, cad_cd, contract, Field25, Field26, Field27, Field28, proj_manager, proj_arch) values ('another test', '10002', 'will', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1', '1', '1').
I hope this helps as I have just about given up.
A