Re: Importing Text Files in phpMyAdmin vs the Infamous

2004-05-11 Thread Stephen E. Bacher
 I have a php website connecting to mysql database.
 How can i have a user export his database through
 the webpage to csv format?
 I would like the user to have a button he can press
 that would pop up a
 save as screen so he can save his database.

The PHP code to do this would look something like this:

 // -- Do not send any HTML before this point -- //

 header(Content-type: application/vnd.ms-excel);
 header('Content-Disposition: attachment; filename=myfile.xls');
 header(Content-Transfer-Encoding: binary);

 $r1 = // -- do query here -- //;
 $nf = mysql_num_fields($r1);
 for ($i=0; $i$nf; $i++) {
  $x = mysql_field_name($r1,$i);
  echo '' . str_replace('','',htmlspecialchars($x)) . '\t';
 }
 echo \n;
 while ($a1 = mysql_fetch_array($r1)) {
  for ($i=0; $i$nf; $i++) {
   $x = $a1[$i];
   echo '' . str_replace('','',htmlspecialchars($x)) . '\t';
  }
  echo \n;
 }

Hope this helps.

 - seb


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Importing Text Files in phpMyAdmin vs the Infamous

2004-05-09 Thread David Blomstrom

--- HACKATHORN, TODD (SWBT) [EMAIL PROTECTED] wrote:
 Don't know if this will help, but this is how I
 offer web clients to save
 as excel in cold fusion:
 
 cfif #ViewInExcel# is  Y
   cfcontent type=application/vnd.ms-excel
 /cfif
 
 the key is to change the content like above.  I am
 not sure how to do this
 in PHP.  But I am sure if you look around you will
 find it.
 
 Then just output the table, with each field broken
 up by td tags.
 No html tags or headings nothing but the table, TD,
 and TH tags need to be
 output.  I have just recently started working in
 php, if I get a minute to
 put a example together in php I'll let you know.
 This will ask them if they want to save the file or
 open the file.
 
 The thing is you have to tell the client browser it
 is a type of file that
 it recognizes.
 
 Hope that helps, good luck.
 
 Todd Hackathorn
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 15, 2004 2:33 PM
 To: [EMAIL PROTECTED]
 Subject: need to know how to export database to CSV
 format
 
 I have a php website connecting to mysql database.
 How can i have a user export his database through
 the webpage to csv format?
 I would like the user to have a button he can press
 that would pop up a
 save as screen so he can save his database.
 I need to also be able that he can only save HIS OWN
 entries (PERSON_ID =
 ***)
 
 Can anyone direct me to a link that shows how you do
 that or explain to me
 how to do this?
 thanks very much
 Noam
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 





__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Importing Text Files in phpMyAdmin vs the Infamous #1148

2004-05-09 Thread David Blomstrom
Sorry, I didn't mean to send that first message; I hit
send by mistake. This is the real message.

I was delighted to discover how easy it is to import
csv files with phpMyAdmin - until I got the following
error message: 

#1148 - The used command is not allowed with this
MySQL version

I found tons of references about this error, including
several fixes online. However, I can't understand any
of it. I tried altering one of my phpMyAdmin files,
but that only made things worse.

Can someone point me towards a tutorial for newbies -
something that specifies the name of the file(s) I
have to open and exactly what I have to modify?

I'm using a preconfigured package from Apache Friends
on Windows XP.

Thanks!




__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Importing Text Files in phpMyAdmin vs the Infamous #1148

2004-05-09 Thread David Blomstrom
P.S. I should add that I'm not trying to import data
between computers or to an online site. This operation
involves nothing but me and my computer.





__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]