I have an Array $f_array whose values are loaded by while loops and SQL Query.
I want to use this array name in a SQL Query.
$sql="SELECT * FROM comment WHERE uname IN ($f_array) ORDER BY ID DESC";
This is what my array looks like after the data is loaded,
array(4) {
[0]=> string(8) "wisahmed"
[1]=> string(10) "test_user1"
[2]=> string(10) "test_user2"
[3]=> string(10) "test_user3"
}
Could someone tell me how can I load this array into the above MySQL Query.
$f_arrayis itself a query? If so, you're probably better of using ajoin.