hi friends
I am having a problem with array while using it in “select” statement
that array contains the following strings
Array
(
[0] => M.A.JINNA
[1] => K.DHANA RAJU
[2] => B.EPHRIM
)
now I am getting error like this: 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 ‘‘M.A.JINNA,K.DHANA RAJU,B.EPHRIM’’ at line 1
please give me any suggestions, thanks in advance
NOTE: I cannot use employee id instead of employee name due to client request
the code is
[php]<?php
$emp = implode( ‘,’, $employee );
echo ‘
’; print_r($emp); echo ‘’;
$sql = “SELECT * FROM securitystaffdetails WHERE employeename IN '” . $emp . “’”;
$result = mysql_query($sql) or die(mysql_error());
echo “
Employee Name | ”;|||||||||||||||
$record[employeename] | ");$record[address] | ");$record[dob] | ");$record[age] | ");$record[sex] | ");$record[mobn] | ");$record[bg] | ");$record[icard] | ");$record[exarmycard] | ");$record[policeclearence] | ");$record[esicard] | ");$record[pfa] | ");$record[pancard] | ");$record[acard] | ");$record[vcard] | ");$record[rcard] | ");