Hi , I have a MySql file which i need to be converted to Excel, Access or simple notepad file. Please let me know if anyone can help. Can pay $5 for this easy thing. You just need to import the sql when the code will run, u will have a table. Export that table to excel or any other format and send that to me. Thanks
no need to pay any $ you can do it your self use phpmyadmin it has option to export data in excel csv format if you don't no how to use phpmyadmin then give me your database file i will convert it for free.
You can stick this code in a page all by itself, name it something like "export.php", then just change your mysql info. You need to change: localhost (although, localhost can most likely stay the same) username, password, database and usertable. After you have that file in place, just go to it in your browser... it should give you the option to open or save in Excel. <?php header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=NAME_YOUR_FILE.xls"); header("Pragma: no-cache"); header("Expires: 0"); mysql_connect(localhost,username,password); @mysql_select_db(database) or die("Unable to select database"); $select = "SELECT * FROM usertable; $export = mysql_query($select); $count = mysql_num_fields($export); for ($i = 0; $i < $count; $i++) { $header .= mysql_field_name($export, $i)."\t"; } while($row = mysql_fetch_row($export)) { $line = ''; foreach($row as $value) { if ((!isset($value)) OR ($value == "")) { $value = "\t"; } else { $value = str_replace('"', '""', $value); $value = '"' . $value . '"' . "\t"; } $line .= $value; } $data .= trim($line)."\n"; } $data = str_replace("\r", "", $data); if ($data == "") { $data = "\n(0) Records Found!\n"; } print "$header\n$data"; ?> PHP: