I know there is mysql_fetch_assoc which puts all data from a row into an array. Is there something equivalent for putting all data in a column into an array? e.g. a list of title ID’s?
Share
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.
GROUP_CONCATandexplode()is probably what you’re looking for as it can get everything in one row. You can group all of the values with a comma usingGROUP_CONCATand then populate the array usingexplode().Your SQL would contain this:
And your PHP would create the array like this (after performing the query):