I'm currently working on an administration webprogram. The organization stores all its clients in a website database. Now, they want to create a file, which can be read by a spreadsheet program so they can use that program to print address-stickers.
All the information needed (first name, last name, address [street, zip code, city], businessname) are stored in a single table. A simple list for the website would be created like this:
Now, what I would like to know is:PHP Code:$clientQuery = mysql_query("SELECT * FROM client ORDER BY businessname");
if(mysql_num_rows($clientQuery) > 0){
while($row = mysql_fetch_array($clientQuery )){
extract($row);
$first_name = mysql_result($clientQuery,0,'first_name');
$last_name = mysql_result($clientQuery,0,'last_name');
$street = mysql_result($clientQuery,0,'street');
$zipcode = mysql_result($clientQuery,0,'zipcode');
$city = mysql_result($clientQuery,0,'city');
$business_name = mysql_result($clientQuery,0,'business_name');
print "et cetera, et cetera, you catch my drift";
}
}
- how do I create a file with the list of people?
- what should it look like so it can be read as a datafile by programs like Excel?
Please advise... All help is appreciated







Bookmarks