Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Mysql/PHP To Excel Ouput?


I can successfully, output contents from two mysql tables into excel but I was wondering if there was a way of determining the actual layout - column sizes because at present they are all over tha place? .....




View Complete Forum Thread with Replies

Related Forum Messages:
Mysql To Excel And Then Email The Excel Doc
I have a good working code for making a excel doc. on the fly. He send the file to the screen and you can save it directly. But I dont want it to send it to the screen but that he save it on the server and EMAILS it to someone. I'm searching and trying to get it work for 3 days, but no luck. I hope you guys can help me out.

This is the code I use the make an excel doc.


$select = "SELECT * FROM dagrapport WHERE dagrapportid='$dagrapportid'";
$result = mysql_query($select);
$datum = mysql_result($result,0,'datum');
$medewerkernummer = mysql_result($result,0,'medewerkernummer');
$export = mysql_query($select);
$fields = mysql_num_fields($export);
$kop = "";
$data = "";
for ($i = 0; $i < $fields; $i++) {
$kop .= mysql_field_name($export, $i) . " ";
}

while($row = mysql_fetch_row($export)) {
$line = ''
foreach($row as $value) {
if ((!isset($value)) OR ($value == "")) {
$value = " ";
} else {
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . " ";
}
$line .= $value;
}
$data .= trim($line)."
";
}
$data = str_replace("
","",$data);

if ($data == "") {
$data = "
(0) Records Found!
";
}

header("Content-type: application/x-msexcel");
header("Content-Disposition: attachment; filename=dagrapport-$datum-$medewerkernummer.xls");
header("Pragma: no-cache");
header("Expires: 0");
print "$kop
$data";

View Replies !
Ouput Formatting...
I would like to have the results of my query display in a grid format.  The code below returns my thumbnails and links them to the actual images. However the entries in the database are simply paths to these images. I thought I could do this with CSS but the way this query is returning the results I am stuck and not sure how to resolve it.  Any suggestions?

View Replies !
Select And Ouput
I'm trying to display a bunch of pictures in rows with 5 pictures per row. The filenames of the pictures are all stored in a MySQL database and the actual files are stored on the server. So, I know how to return and output all of the records from a MySQL table using a while statement.

However, I need to only output five of them, insert a break in the HTML to start a new line, and then output five more and another break, and then do it again until there are no more pictures left. Anyone have any ideas?

View Replies !
Ouput Image
I am trying to output an image with text coming from a database"

$image=mysql_result($result,$i,"image");

trying to output it like this:
<img src=../prod_images/" . $image . " height=90>

problem is that some images have a space in the text like "image 1". When it is outputted onto the screen, the browser does not read anything after the space. How can I get around this?

View Replies !
How To Ouput A Html Page To PDF ?
I been able to output data from MySQL page and put in into a generated HTML page using <TABLE>.

Is there any fastest way to convert the HTML page directly into a PDF document for the user to download when the user click on a link, juts like the one (PDF Version / Printable Version) of Devshed.com?

View Replies !
I'm Getting Strange Ouput In Url String
I've been getting strange output in my url string within my app lately. It adds stuff like ?1174406969965 when I'm not even posting a url string on my forms. This doesn't seem like a big issue, but I was wondering if anyone has ran into this before. Code:

View Replies !
HTML Ouput Gets Scrambled While Parsing
On a page I want to display rows of recordset, coming from a mysql database. The problem is that somewhere halfway, PHP seems to generate messed up HTML code for no reason at all.
e.g:
The first 54 records display correct syntax. Code bellow is an examlpe of a row ouput for record 54 Code:


View Replies !
Sorting LDAP Ouput With PHP3
I am wanting to create a telephone list of all users on a LDAP database. I have managed to extract the data, but cannot get the code to sort the results in alphabetic order , based on surname. My code:

View Replies !
How To Ouput PDF Directly To The Browser From PHP Script
I know how to ouput PDF directly to the browser from PHP script, but is there any way to
create a PDF file to the server harddisk from PHP?

View Replies !
No Ouput After ADODB Connection Attempt?
I am trying to connect to a MSSQL Database but I am having some problems. I create this function in a file (Called functions.php) Code:

View Replies !
From MySQL To Excel (through PHP)
it's possible to manage an exixtent excel file with PHP? :
i already have an excel file formatted in many fileds,
and i have to modify only some of these fields (i need to add data).

unrotunately with tutorials i found trough google i can substitute tables
in my excel file, and i cannot modify the fields, it overwrites and stop.

View Replies !
Excel To MySQL
I currentley use Navicat for most of my Excel to MySQL conversions. But I would like to get this web based.

Ideally the user would submit a standard .xls via a form upload.

Now here is the complex part. The file has 6 spreadsheets in it. Each spreadsheet has different columns and some of those columns need to go into different tables. So it's NOT just xls to one mysql table. It's actuallt one xls file with numerous spreadsheets going into different MySQL tables based on the column names.

View Replies !
Excel > XML > MySQL
I am wondering if there is a way I can use an upload form to upload an Excel XML export or just an .xls file to a MySQL database. I am also wondering if there is a tutorial out there that can help. So far I have only been able to find sites that offer tools to do it, but I want to use an upload form instead.

View Replies !
Php , Mysql And Excel
IŽd want to pass the result of a mysql to an xls file (excel) , obviously all into my php page.

Is it possible? You know, can I pass the results as a whole or do i have to extract each parameter and put it into an xls file ( i have no idea how to do it).  Maybe some of you have done it or can give me a clue.

View Replies !
Mysql To Excel
I need to write a program to transfer data from mysql database to Excel. Is there any free php code to do it. I tried one of the code which I got through search .....

View Replies !
MYSQL Excel
I am creating a php/mysql system to run daily chores. That is simple enough. The hard part is the data that populates the database is sent each week via excel spreadsheet (always in the same format - thouhg row numbers change - coloms don't) I want to get this information using php and put the stuff I need from it in the database. Now I have found Navicat which is a great application and did what I needed only I am looking not to use a 3rd party program I simply want a button on the site that wil let you upload a spreadsheet and fill the database correcting any info in the databse allready that is reppeated etc as I won't be the one doing this and for most the users of this post things like navicat are simple enough for the people using the sytem I am creating that is a bit too much like hard work even with all the training.

So my question is can this be done and where should I start I pretty much to the point where I realise I will need to open the excel file and stick all the information into an array and then take it from the array and insert into databse. But how do I do this. some links to usefull info or some sample code would help I am quite quick to pick this stuff up when I get on to the right trail.

View Replies !
Excel To MySQL Using PHP...possible?
I've read almost all the Excel XLS to MySQL info in the PHP help section. No one seems to know how to do this. Just says to covert the file to .csv first. Problem is that a lot of my clients will not have excel and the file (the .xls) is coming directly from their product manufacturer. So having all the have to get excel is not going to happen.

Only thing I found was a reference to : http://nstoia.com/excel2csv/excel2mysql.zip ... which no longer exists. It was supposed to contain a full PHP script on converting XLS to MySQL. Yet the file doesn't exist and the only other things I can find with that file name is a perl script. Sorry but I really don't want to have to get into perl to do this. I know there has to be a way, since you can easily export SQL to XLS.

Also, no code snippits or tutorials out there either.

Maybe, someone here has found something I haven't and can enlighten me.

View Replies !
Excel CSV To MySql
I have a Excel CSV file with 5000+ records on and I would like to put this into a PHP MySQL database, I have CPANEL and PHP MY ADMIN but i cant seem to find where the section is to upload the file?

Can anyone enlighten me to how i go about doing this? I will probably split the csv up into smaller chunks so upload time is not timed out..

View Replies !
Mysql -> Excel
I'm migrating a mysql table into an excel spreadsheet using headers. The problem I'm having is that there are newline characters in some of the fields in the original table that are triggering a new row going into excel.

View Replies !
Exporting Mysql To Csv Or Excel Via PHP
Hi, I need to know how to write a php code how to export the mysql database into CSV or Excel or ISO 20001 format. or if you know any tutorial site for it.

View Replies !
Need To Convert Mysql To Excel?
I need to display data from MySQL to Excel format. I looked at several excel classes, but they are missing three things that I need.

1. To be able to output a cell larger than 255 characters.
2. Be able to keep line breaks in cells.
3. be able to format the cell widths

I am currently using a tab delimited set up with excel http headers, but I can not format the cell widths.

View Replies !
Excel Data To Mysql
Is this possible to transfer excel data to mysql database?

View Replies !
Data From MySQL Into CSV For Excel?
I've a survey form that I need to get data from and put into a mySQL
database.
Easy, can do it eyes closed.

But, then I need to be able to take that same information and convert
it (either directly or pulling it back out from the database) into a
CSV (or any file for that matter) that can be easily imported, added
into an existing Excel database.

I've no idea how to do that. (I can query the database, that I can do,
and create recordsets, AND create text files, but I've never created a
CSV file before.)

Is there a source, a good Web site for example, that explains that
kind of process pretty well?

View Replies !
MySQL Dump To Excel
I get an error on the actual dump. It does dump the file, so I know I am connecting and downloading. But, it puts all records in one line of text in the browser, and does not give me the prompt to download. Code:

View Replies !
Coding Excel For Php And Mysql Use?
Ok, so i have an excel document that i can enter my current golf scores in on and it'll calculate different stuff with the data that i enter...

Is there a way that i could use the formula from excel that calculates that data, and make it so that one could use it on my website and it would also save and store the data that they entered, as well as calculate it like excel does and display the current data..

So quick and to the point, I want a database based way of users using what i would use at home kinda, from excel.

View Replies !
Mysql Database To Excel
This script is to export Mysql database to excel, I'm getting the following error:

1) Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource
and
2) Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource

can someone help me correct this problem? Code:

View Replies !
Excel To MySQL Import
I need some help with a script that wrote to import an excel spreadsheet into mysql. It is supposed to update records with the same phone number and insert when there is no match.

This is meant to eliminate duplicates within the database. It doesn't work quite right though....

View Replies !
Excel To Mysql Conversion
I know its a little off topic, but I was wondering if anyone knows of any freeware excel to mysql conversion utilities? There are a lot of pay ones floating around but was hoping for a free one.

View Replies !
Proccess A Excel DB With PHP To Get In On Mysql
I was wondering if theres a way (im 50% there is) to extract data from a excel form to mysql table , i dont know if theres another way, but i think PHP can doit, any idea?


View Replies !
Excel To MySQL With DBCS
There are many tables that I store them in XLS form. Many columns of these tables are stored data by using DBCS -- Big5.

Is there any way that I can import datas from those XLS files into MySQL tables?

Because the ""--0x5C is a part of many Traditional Chinese characters in BIG5 code set. So I can't use such as "mysqlimport" utilities to import data from XLS to CSV to Mysql. Or do I miss some options when I use mysqlimport?


View Replies !
Export MySQL To Excel
I have no problem exporting data from MySQL to Excel however I've run across two new additions that we'd like to make:

1. We need to add some text to the first few rows before the exported data to denote what the exported data is referencing.

2. We need to add a new column at the end of each row for "TOTAL". The columns are currently created via the exported data however we won't be exporting any data for the TOTAL column, rather we need to use some forumla logic to fill that column in (see #3 below).

3. We need to add some Excel forumla logic to the exported file to calculate the price of a reservation against the total number of reservations.

if ($action == "billing") {

include("../includes/dbconnect.php"); .....

View Replies !
MySQL Data To Excel
It isn't displaying my table column names as the heading any clues.This is what I have:

<?php
include 'library/config.php'
include 'library/opendb.php'

$query = "SELECT * FROM tbl WHERE `Member`='A'";
$result = mysql_query($query) or die('Error, query failed');

$tsv = array();
$html = array();
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
$tsv[] = implode(" ", $row);
$html[] = "<tr><td>" .implode("</td><td>", $row) .

View Replies !
Download MySQL Data To Excel
I have no issue in getting my data to download into MySQL, but can you

A) Style the info? So like make a certain font and size?

B) It isn't displaying my table column names as the heading any clues?

This is what I have PHP Code:

View Replies !
Importing Excel Into A MySQL Database
i have an excel file I want to read into a database.  I found a tutorial which says to save the file into a xml file, then it basically gets all the data out, and puts it into an array Code:

View Replies !
Export MySQL To Certain Excel Cells
I have  .xls files that I want to be able to export MySQL data into.  Is there a straightforward way to do this...I'll really only be inputing 2-3 values.

So pretend I have:

$test1
$test2
$test3

And I want to export them into test.xls in cells  A1, A2, A3.  Can someone provide the method for doing this?

View Replies !
Excel File Imported Into MySQL
I have a Excel sheet, you can save this sheet as a wide range of extensions, the main one being .xls, but you can also do .txt tab delimited , html, .cvs, etc.... I'm very new to PHP and SQL. I'm trying to grab several columns of values, with like 200 rows. Each Column is labeled say - Model - Manufacturer - Name - Item # - Serial # etc... with each row under it displaying the info for that item.

Is there any way I can take that excel sheet and import it into the MySQL database or PHP?? I'm very new, so a very detailed explanation would be of GREAT assistance. Thank you allot in advanced, this will save me 3 hours of work for something that might be done in 10 minutes.

View Replies !
Transfer Excel Sheet To Mysql
Is it possible to transfer a list that I have stored on my computer in microsoft excel to a table in mysql database?

View Replies !
Converting Excel To Mysql Tutorial
Wondering on how to convert excel spreadsheet to MYSQL database easily without incurring any cost? Visit this web site

http://excel2mysql.f2g.net

for a tutorial. By following simple and intuitive steps, you will be able to get a mysql database. But, get a free copy of phpMyadmin from the internet first. It's simple to get it, just type phpmyadmin at the any search engine.

View Replies !
Export MySQL To Excel Modification
i am basically creating a tool which calculates the commission a sales person will get and display a break down off the calculations for each deal.

the tool allows you to create a report of all sales persons or individual sales persons.

i have found a script which exports mysql data to an excel spreadsheet, i have slightly made some modifications too. I have this all working perfectly.

each deal displayed goes on a new row and each deal has a total_commission.

however i need to modify the code so that i can get a grand total of total_commission for each sales person. i need to get this information on the same worksheet or on a new worksheet in the same workbook.....

View Replies !
Exporting MySQL To Excel Problem
I've been able to export any data from MySQL to a csv file, or to excel. But I've been having problems with stripping out all html code,a nd whenever there is a comma in the data, it sends all data to the next cell in excel.

Let me show you what I've already done.


<?php if (!$HTTP_GET_VARS['submit']) { ?>
<?php
echo "Export and Save Customer Data onto your Local Machine";
echo '<form action="'. $phpself.'">'
echo '<input type="submit" value="Export" name="submit"></form>'
?>
<?php
}
else
{
$contents="Board Category,Questions,Answers";
$user_query = mysql_query('select
f.faqdesk_id
, c.categories_id
, f.faqdesk_question
, c.categories_name
, f.faqdesk_answer_short
from faqdesk_description as f
join faqdesk_to_categories as f2c
on f.faqdesk_id = f2c.faqdesk_id
join faqdesk_categories_description as c
on f2c.categories_id = c.categories_id');
while($row = mysql_fetch_array($user_query))
{
$contents.=$row[categories_name].",";
$contents.=$row[faqdesk_question].",";
$answer = str_replace(',', ',', $row[faqdesk_answer_short]); // escape internalt commas
$contents.=$answer."
";
}
$contents = strip_tags($contents); // remove html and php tags etc.
Header("Content-Disposition: attachment; filename=export.csv");
print $contents;
?>

It stipped out html tags, but it is still leaving in &nbsp;

I'm sure there is a fix or replacement function for that. However, the commas are still giving separation problems, even with the str_replace function.

You can see the excel results here: www.mastertheboard.com/board_topic_export3.php

It is a list of questions and answers for the military soldiers in my units.
There is also some other formmating issues having to do with numbered bullets. But I'm not sure how that is fixed.

View Replies !
Downloading MySQL Data To Excel
Wanted some advice on downloading data from MySQL into an Excel spreadsheet... The initial site I was working with was .NET but had to be changed to PHP. When I look at the .NET example page of 'Download', click it it donwloads to an Excel spreadsheet... When I open it up it's all nicely layed out already even has the table names from the database as heading for the Excel columns...

I have been able to achieve a download of my data in a PHP page but when IT opens it's not formatted at all, and doesn't have the table names as the headings... Does anyone know if this can be done? Surely you must be able to neaten up the Excel file to some extent...

View Replies !
Populating An Excel .csv File Rather As Well As MySQL
I am very new to this and have what may be a ridiculous question. Is there a way to have info populate both the MySQL table and an Excel .csv sheet? I know that I can go into PhpMyadmin and dump the data but this seems to be a bit cumbersome.

View Replies !
Import Excel Csv File Mysql
i want to import csv file into database?

View Replies !
Import Data Into Mysql From Excel
I am trying to import data into mysql from excel. The issue is that the data has some char with spanish accents. I am writing a php script to do that. When I try to display data containing those accents in php, I get a beta symbol for every char that has an accent on. How can I preserve the accents in php and import it to sql.

View Replies !
Updating Word/excel Thru Mysql
I'm working on a project which has all data in a mysql database. i have set up forms for various inputs etc and all is well. Now comes a problem - atleast for me.

There are some files in excel and word and these are updated by some users when an event takes place as under: a. user visits a customer site to check work in progress. b. he prepares a pre -install report which is an excel file. Code:

View Replies !
Upload Excel Files And Keep The Formatting Of The Excel File.
I have been tasked to create a website for a company. They are wanting a content management system, where they can upload a document and the contents will be displayed. I have experimented with file_get_contents() and got this working. But What they are wanting is to be able to upload excel files and keep the formatting of the excel file. Is this possible. I have loooked into COMS but i am not sure if this is right, as i dont want to download a file i want to display it.

View Replies !
*downlaod* A Whole MySQL DB, And Export It Into MS Acces / Excel ?
is there anyways to *downlaod* a whole MySQL DB, and export it into MS Acces / Excel ?

View Replies !
Putting Mysql Data Into An Excel Spreadsheet
I want to take data from a MySQL database and stick it into an Excel Spread sheet so the speadsheet is upto date and with data format intact. any easy way to do this?

I don't want to just drop data into the spread sheet. Diffent bits have to go in different places. Basicly the fields names arn't going to be the colum names ect.

View Replies !
Import Excel File Into MySQL Database
Importing an Excel file, containings URL, into a MySQL database.

It must be the simplest process possible for the end user, avoiding as far as possible all steps of converting and/or transforming files. Of course, we want to preserve the identity of the URL.

View Replies !
Reading Excel To MySql Or Comma Delimited ...
right direction on how to deal with an xls
flie.

but the only other file I have to work
with is pdf.

I'm not sure, is xls the better of two evils?


View Replies !
Export MySQL Data To An Excel / CSV File
I've been trying to export MySQL data to an excel / CSV file, and I have it pretty much populating the Excel properly with the data; however, the Excel sheet also includes the entire HTML formatting + CSS/JS coding before the export code. I've tried getting rid of it with strip_tags, to no avail. Is it because the export code is to the middle of the file? I tried to move it into the header, but that didn't work either. Any ideas? Code:

View Replies !
Import Excel File To Mysql Database
i want to import excel file into mysql database .

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved