$strSQL = "SELECT * FROM Test";
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
$dd = $_POST["ddlSelect"];
$size = count($dd);
for ($i=0;$i<$size;$i++)
{
//$strValue = explode(",",$_POST["ddlSelect"]);
$strSQL ="INSERT INTO Test";
//$strSQL = "INSERT INTO Test(tel)VALUES $dd[$i] ";
//$strSQL .="(tel)";
$strSQL .="VALUES ";
//$strSQL .="('".$strValue.="') ";
$strSQL .=" '".$dd[$i]."' ";
$objQuery = mssql_query($strSQL);
if($objQuery)
{
echo $strSQL;
}
else
{
echo "Error Save [".$strSQL."]";
}
}
mssql_close($objConnect);
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '1'. (severity 15) in C:\AppServ\www\for_add.php on line 32
Warning: mssql_query() [function.mssql-query]: Query failed in C:\AppServ\www\for_add.php on line 32
Error Save [INSERT INTO TestVALUES '1' ]
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '2'. (severity 15) in C:\AppServ\www\for_add.php on line 32
Warning: mssql_query() [function.mssql-query]: Query failed in C:\AppServ\www\for_add.php on line 32
Error Save [INSERT INTO TestVALUES '2' ]
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '3'. (severity 15) in C:\AppServ\www\for_add.php on line 32
Warning: mssql_query() [function.mssql-query]: Query failed in C:\AppServ\www\for_add.php on line 32
Error Save [INSERT INTO TestVALUES '3' ]
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '4'. (severity 15) in C:\AppServ\www\for_add.php on line 32
Warning: mssql_query() [function.mssql-query]: Query failed in C:\AppServ\www\for_add.php on line 32
Error Save [INSERT INTO TestVALUES '4' ]
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '5'. (severity 15) in C:\AppServ\www\for_add.php on line 32
Warning: mssql_query() [function.mssql-query]: Query failed in C:\AppServ\www\for_add.php on line 32
Error Save [INSERT INTO TestVALUES '5' ]