My Database
id username
1 xxx
2 bbb
3 vvv
4 bbbbbb
i need output as
array('xxx','bbb','vvv','bbbbb');
Using PDO i need to fetch username from db & make that to array, is to for checking username exists
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re only checking if a username exist, it would be optimal to modify your query to do just that, instead of returning excess data:
If you do happen to need an array of usernames, do something like the following: