Not sure how to state this, but here it goes.
I am querying a SQL server and placing the results into a MySQL database.
It was all working just fine until one particular column (from the SQL Server) is giving me problems.
The column is called 'EmployeeName' and each record holds the name of an employee in this format: LAST~FIRST MIDDLE
So for example: BUSH~GEORGE W
This isn't so much of a problem with displaying, but taking the name and inputting it into MySQL has not worked. However, if I leave out that particular column, then the INSERT query works just fine - for other columns.
I am suspecting the ~ is a culprit of the issue, but I'm not sure.
Below is the code I am performing:
<?
$connect = odbc_connect("SQL_DB", "user", "password");
$sql_query = "SELECT *FROM Employees";
$result = odbc_exec($connect, $sql_query);
while(odbc_fetch_row($result)) {
$Name = odbc_result($result, 'Name');
$EmployeeID = odbc_result($result, 'EmployeeID');
$mysql_insert = "INSERT INTO employees(Name,EmployeeID)
VALUES($Name,$EmployeeID)";
$result2 = mysql_query($mysql_insert,$connection) or die(mysql_error());
}
?>
The error I get is: Unknown column 'Array' in 'field list'
Does anyone has an idea of why I can't insert this one particular column?