I submit a form and am trying to look at the POST[]
(
[Name] =>
[Manufacturer] =>
[Model] =>
[Width] =>
}
Im trying an INSERT query but
ERROR: Could not able to execute INSERT INTO unknown_types (name,manufacturer,model,external_width,external_height,external_depth,weight,total_plugs,required_plugs,requires_diverse_power,standard_copper_ports,standard_fiber_optic_ports,unidentified_ports,airflow_type,mounting_direction,Front_Cols,Front_Rows,Back_Cols,Back_Rows,power_consumptionu,network_speed ) VALUES ( ‘’,‘’,‘’, ,1, ,‘’,‘Front’,). SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘,1, ,’‘,‘Front’,)’ at line 3
I gather I Need NULL in the place of blank values for the query to work, but
if(empty($_POST['Width'])) { $Width = NULL; } else { $Width = addslashes($_POST['Width']); }
seems to do nothing to the query and I get the same error.