here my code-
$sql = "INSERT INTO tblpin ('pinId', 'ownerId', 'usedby', 'status') VALUES ";
for($i=0; $i0)
{
$sql .= ", ";
}
$sql .= "('$pin[$i]', '$ownerid', 'Free', '1')";
}
$sql .= ";";
echo $sql;
mysql_query($sql);
if(mysql_affected_rows() 0)
{
echo "done";
}
else
{
echo "Fail";
}
output: ** INSERT INTO tblpin ('pinId', 'ownerId', 'usedby', 'status') VALUES ('13837927', 'admin', 'Free', '1'), ('59576082', 'admin', 'Free', '1'); Fail
why it is not inserting values when $sql query is right?