The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> PHP Mysqli select to csv
nuddernuby
post Aug 27 2015, 04:16 AM
Post #1





Group: Members
Posts: 3
Joined: 27-August 15
Member No.: 23,453



Could someone save me from insanity and provide a working script for the following simple problem, please. (I've tried many and failed)

I have a table 'projects' with field 'projectname', currently populated with five records, say A,B,C,D & E.
I need to store an the array of these records in this format: $arr=("A","B","C","D","E") or output it to a csv string in csv file.

I can echo the results but fail to get this into the required format/file.

Basic query is:
$query=mysqli_query($conn,"SELECT projectname FROM projects");

What then?

Apologies for the simplicity of the problem.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 10:53 AM