Hey guys - I really need help on this one.
It workes in phpMyAdmin.
A person inputs lots of sql querys (all generated by a program I made) into a text area and hits submit.
<?php
include ('includes/connection.php');
include("includes/header.php");
$insert_query = $_REQUEST['insert'];
$i = 0;
if($insert_query != NULL){
$insert_query = explode("');", $insert_query);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
for ($i = 0; $i < sizeof($insert_query) - 1; $i++)
{
$insert = $insert_query[$i]."');";
$result = mysql_query($insert_query[$i]); ?> <br/> <?php
check($result); // this returns mysql_error() is result = false.
echo $insert; ?> <br/> <?php
}
// header("Location: cus_call.php");
?>
The problem in on the web page I get this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''R1 - NBS Repeater Broadband' at line 2
My INSERT code is:
INSERT INTO `customer` (`jTrack_id`, `FName`, `LName`, `address`, `county`, `xCoord`, `yCoord`, `customer_priorty`, `SLA_commencement_date`, `SLA_end_date`, `SLA_notes`, `case_closed`, `stage`, `phoneNumber1`, `phoneNumber2`, `EmailAddress`, `network_recommendation`, `nominal`, `original_tariff`) VALUES
(ABC-123, 'James', 'Dean', 'Charls town, Mayo', 'Mayo', '-7.78000', '59.00125', 'Fault', '2010-05-30', NULL, NULL, 'no', NULL, 087332373, 065682232, NULL, 'External', 'CA221', 'R1 - NBS Repeater Broadband');
Please please help!!
Regards
David