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




Exporting Data From Mysql Using Php In Excel Form..?


I have a table in mysql wich contain a sim_number field which is 19 digit unsigned number. i have designed a script using php headear command for exporting data as excel. It is working but with the follwoing problem.
Since sim_number is 19 digit number when it get exported as .xls file. now when that .xls file is opened, excel automatically detect this sim_number as number and , since excel can store only 15 digit in number format it converts its last 4 digits to zeros.

Is there any way to get this sim_number exported as text so that excel store complete 19 digit number in text format. I cannot attach some charctor to this sim_number because of restricion on file format.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Exporting Data To MS Excel
How to export data to xls file using PHP? Is it possible to edit a
look of document (like cell size, borders etc.) ?

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.

Exporting Mysql Data To CSV In Php Code!!
how can i export the results of a query to a csv file with the columns name in the filed name of the csv???suppose USERID is the 1st column the USERID should be named in A in CSV while its data is under of it??is it possible?

Exporting To Excel
I followed the really cool how to at http://www.phpfreaks.com/tutorials/114/0.php but I had to change some things to get it to stop giving me errors. After I did that It seemed to work great but it put everything into one cell in the excel document. Code:

File Exporting To Excel
This code exports data from my DB into an Excel file by using " " as the delimiter. It runs through the script over and over until it's done creating an Excel file with columns of data, but is there a way that I can add a value to the beginning of the script - thereby naming the columns? Code:

Exporting Database To Excel (via Website, NOT PhpMyAdmin)?
I know via phpMyAdmin I can export my database in Microsoft Excel 2000 format, and can check a box to 'Create field names as first row', but it doesn't give me the php code used to achieve this. I need to have a page on a website so the administrators will be able to do this for themselves, does anyone know if this is possible?

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

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?

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:

Passing Form Data To An Email Address/Excel Sheet On A Local Computer
I am right now learning PHP & want to know if there is a way to send
web form data to an Excel sheet located on a network. My windows xp PC
doesnot have a copy of Excel. Also i am not connected to the internet,
its a local computer.

What i am trying to do is to make a PHP script which will send a simple
form data to an excel sheet (or create a new Excel sheet) on another PC
on a network.

Since i am not connected to the internet, i will not be able to send an
email (anyway, sendmail is not available on Windows OS), nor do i have
any server on windows.

Is it possible to send form data to Excel sheet on local computer? Even
my PC is a local PC. Some one was saying its possible thru Windows
Scheduler.

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.

Transferring Excel Data To Mysql Table
Is it possible to transfer the whole data from excel sheet to the mysql database?

How Data Can Be Imported From Excel Sheet Into MySQL Database.
How data can be imported from Excel sheet into MySQL database. And also
data can be exported from MySQL to Excel sheet.

How Data Can Be Imported From Excel Sheet Into MySQL Database
How data can be imported from Excel sheet into MySQL database. And also data can be exported from MySQL to Excel sheet.

Exporting DB Results (or Flat File) To An Excel File
I have two scripts, neither of which have been written, that will need to collect user information. They will either write to a flat file or to a MySQL DB, and I need a way for an administrator to grab an Excel file based on this data.

First, no more than 100 people are expected to sign up, so flat file is certainly viable. Do you recommend I use DB or flat file?

Second, based on your recommendation, how should I go about exporting the user data to an Excel file? There will be about ten form fields per registration to give you an idea.

Problems While Exporting Data Using Pipe Symbols
I am facing problems while trying to export data into
pipe format. In fact I am fetching records from mysql database and then
trying to create a text file ( using pipe as delimeter) , intending to
open in Excel.

The data is been inserted from textarea fields, where the
user can write text and may press enter key to format his text
accordingly. Now when the data entered into the database it keeps some
unidentified value so as to keep the formatting. Hence while displaying
the text file I find that lines are seperated according to the format
user gave. Thus creating the problem while opening up in the excel
file.

example:

Comparing Form Data To Mysql Data
Im interested in building a script that would take form data, a variable like an address, and compare it with a known address in a mysql table (called addresses), then if there is a match log the address information in a separate table called (addresslog), and return the visitor to a certain page. If there is no match between the address entered in the form and known addresses then the information is still logged into the addresslog database but the visitor will be sent to a different page.

I'm still new to this, and am working through the logic and the syntax, but I believe I'm close. It's still not working, I have all of the proper tables, maybe I'm way off with the coding so I thought I would seek out some expert advice. Here's the entire script with as much explanation as I could give. PHP Code:

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";

Exporting Mysql
there is a function in phpmyadmin that exports all the data etc from a mysql
database to an sql text document, or Excel File.

I would like to know if there is an inherent way of doing this without
phpmyadmin. - straight through php.

Exporting From MySQL To .csv Using PHP
I'm sort of new to PHP. I am using the following code to retrieve a
column from a database and to put all of the results into a .csv
file. This allows creates a .csv file, but only lists the first
result from the database. It is not returning all of the rows. I
know the issue is somewhere in my "foreach" but I'm not sure where.

<?php

$selectSql = "SELECT artist_name FROM lounge_products";
$selects = $db->getAll($selectSql);

foreach($selects as $select) {

$content = $select[artist_name].",";

}

Header("Content-Disposition: attachment; filename=export.csv");
print $content;
?>

Exporting MySQL Table
Hi,

How do you export a MySQL table to a tab-delimited text file so I can put it into excel?

Exporting MySQL Database To File Using PHP
I want to export my database to a file that is hosted on the same server. I got this script from somewhere, but it doesnt work. Most likely because I cannot access mysql command thru the shell_exec() command, however, I am able to use the wget command thru the shell...

Here's the code I was trying to use:

Getting Data From Mysql To Put Into Form
i am trying to set up a page that will allow the user to select a name from a list. The details of this name(ie, last name,address, job etc) are then taken from a database and put into a form. If any changes are needed the user makes them then presses a submit to update the database.

I can get the information out of the database and into the form fields but i have one small problem...

In the address field i can only get the first part of the address...
ie

if the address is 123 Sample Street

only 123 gets put into the form field.

How do i get the rest of the address to appear?

i am sure it is quite simple but cant quite put my finger on the answer!

my code is:

Address: <input type="Text" name="address" value =<?php echo $myrow["address"] ?>><br>

where $myrow is the array holding the results from my database query.

Any help would be appreciated!

Web Form Data To MySQL DB
I pulled this script off of an MySQL article from the MySQL website itself. I adjusted it to my needs and I could connect to the DB, it could find the proper table, but it doesn't enter the data into the database table. So I pulled the original script off in hand, created the DB and table it had listed and still the same problem... it can't connect. Here's the script: Code:

Sending Form Data To MySql
I have this simple HTML file that is supposed to send one variable (char_name) over to my mySql db, but its not wanting to work. mySql table has a length of 25 and its a varchar. It has one column thats called char_name. PHP Code:

Posting PDF Form Data To MySQL
I am working on a script that will take information submitted from a pdf form and store the field data to a given mySQL table. I just cant figure out what is wrong with my script. I am able to get the data from the pdf form, and set it as a variable so I can work with it in php. It is displaying the proper data when I echo() it, and I get no mySQL errors. It looks like everything should work, but when I check my database, nothing has been updated....

Form Validate Against MySQL Data
Was just wondering where you would start if you wanted to validate against MySQL data. In this case, validate a username and password from a form against a username and password in a MySQL database.

Also, how do you make it so that when you have a 'password' form field on a document, the letters don't show up? It shows up as *****.. is that some type of encryption??

One more thing, how would I go about 'turning off' or 'closing down' a sign-up page once the sign-ups have reached 32 users?

Reading MySQL Data In A Form Field
i am in the process of building an admin page for a site. Most of my site data is being held in MySQL and being pulled using PHP. The problem I have is while trying to build an Admin form to change data in MySQL, I want to have the data that is currently in the table be automatically put into the form field, so they can see what they are changing before they change it, or so if they do nothing it keeps the same data in it. My code is as follows:

Form To Insert Mysql Row *and* POST Data
I'm reasonably new to PHP and after searching all over the place can't find anything useful

I need to insert some variables into a mysql row and then POST variables to another web page using the same form

The page i'm posting to is an SSL (bank hosted)ecommerce transaction page which I have no powers to change

I don't have any problems inserting just mysql rows or making html forms to post separately, I just don't know where to start to get the one form to do both.

Entering Data From A Form To A Mysql Database
I'm trying to enter data from a form with the fields name and email into a mysql database called newsletter, as you guess it's a newsletter sign up. this what I have at the moment: Code:

Sending Data Form A Vb Program To A Mysql DB
Hello, as this falls under both VB and PHP I have posted this into two
newsgroups (this is the first time I've done this so if it is mucked up
then I'm sorry).

Anyway I want to make some simple games with in VB 6.0 and then I want
the highscores to go to the server (which uses PHP and MySQL). And if
its possible I would also like the highscores to be viewable on the
program AND on my site.

PHP Part:
I think I need to set MySQL up so it can be accesssed from outside of
the server, but I'm not sure.

Sending Mysql Data To An Email Form
i have a page which displays all the products in the database using a page such as: products.php?id=1 each product is displayed on that page also on that page i have info pulled out from the database such as:

Product description
product title
Question
product website

at the bottom of the page i have a email form done in PHP this form is static its not pulled out of database or nothing basically each product has a question where the user has to answer then the user has to submit his/her answer via an email form: the form has 3 fields:

1) name
2) email addy
3) Answer

This is the code for the FORM page its one qries2.php PHP Code:

Insert Data From Form To MySQL Database
I have run createTable.php and everything is created. Now I want to run insertData.php. I want the user to enter stuff in the form & everything must be fill in before they click the submit button. It will call submitData() & all the information was enter will insert into the database. PHP Code:

Send Multiple Form Data To Mysql
Im trying to use a textarea form field to input oh say 1000 entries to the mysql database. Each new line in the form field constitutes and new data entry and each table field would be delimited with a , or a Š.

I know I need to have php grab each line and throw it into and array for processing to the db, but like I said, Im too new to get the gist of where I need to head to.

PHP Form Overwrites MySQL Table Data
I have a PHP form sending data to a MySQL table, and I am wondering if I can add some sort of code to the PHP page that will make the form data overwrite any potentially old data already in the table.

Importing Data From Excel Into PHP
Is it possible to import data from excel file into php and than put it in
mysql database?

Is PHP Able To Extract Data Out Of An Excel Spreadsheet?
The only form of database we use is an Excel database.
Otherwise is it possible to import the relevant spreadsheet data
into say MySQL?

Perhaps it is possible but does anyone know how or point me
in the right direction.

Show Data From Excel File
My clients want to upload some excel file and want to view data in their site from those excel files. They may update the excel files regularly and the content of the dynamic page should be changed according to the excel files.

Is there any way to connect excel files using php? I'm planning to store the data of excel files into mysql database when they upload the files from browser's interface.

Data Download From PHP/MSSQL To Excel
I have a webpage that displays data from a SQL database in table
format. I found information on how to create a way to allow a user to
download this information to Excel using 'Header()' in the PHP code.

Header("Content-Type: application/vnd.ms-excel");
Header("Content-Disposition: attachment;
filename="filename.xls"");

I setup a link on the display page that sends the variables needed for
the SQL query to a different PHP page and the link is targeted to a
bogus target window (target="excel") so that it doesn't change my
current display. This is meant for people who find the proper display
they want and then want to save it but also want to continue display
other data in the current window.

If the user clicks the link it then opens a browser window and prompts
the user with the typical IE download prompts, which is fine. But if
the user chooses to 'Save' the file to his/her pc and then goes
through the steps to save it, the browser window that was opened
doesn't automatically close. If the user chooses to open the .xls or
chooses to cancel the download, then the browser window closes just
fine.

Can Php And Mysql Process Stored Form Data Created Offline?
A customer of mine has given me a task that has me stumped...

My customer meets with his new clients away from his office with a laptop. At his office he is running a redhat server, apache, php, mysql....the usual stuff. His laptop has windows xp.

When he meets with the new client, he wants to fill in a from and have the data stored on his laptop. After returning to the office he would like to upload via his web app (php/mysql based) the new client data into his database. Basically:

fill in form offline ---> return to office and connect to web app ---> upload and review stored form data ---> process new client data into database

Where do I begin? How do your create the form? How would you process the form? What's the simplest way to process the data into the database? I'm sure I'm missing a few questions here.

Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:

How To Format Data In A File Which Will Be Open In Excel?
I am trying to generate a file with php from a database extract that i would like to be open in excel.

What i need is to format the content of the file in CSV i guess. The 'fgetcsv()' can do the job by formating the content of an existing file.

Is there an other option than to create a file with my database content, save it on the server and open/format it with 'fgetcsv()'?

Dumping Data To Excel Via Https And Ie6 Broken
I thought I would contribute a solution for once.

We have a standard SUSE LAMP (Linux Apache Mysql PHP) server running
some custom apps, of which one component is dumping reports out to
excel. We are running this with https and all was good for a few
months. IE6 and Firefox worked fine. One day around the end of July
2005, IE6 stops doing the excel part.. Excel errors out with a "Could
not open 'https://blah.com?report.php'" . Firefox continues to work
fine. It turns out something has changed in an IE update from
Microsoft that breaks the old method we employed to launch excel and
feed it the data stream. This php code below contains the new headers
which now make this work for us again. Firefox continues to work
flawlessly with the new headers also!

<?
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=report.xls");
header('Cache-Control: private, must-revalidate');
header('Pragma: private'); // allow private caching
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
session_cache_limiter("private, must-revalidate"); // allow private
?>

BTW, we are using PHP 4.x and apache 1.3.x

Html Form Results To Excel Spreadsheet
This sounds like overkill, but is there any way I can take the results of an html form, and plug them into their respective cells on a excel spreadsheet?

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.

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.

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.

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.

Posting Form Data And Also Allow To Download Form Data
i have a client that whats to post form data to a database but he also wants users of the script to download it aswell how will i got about doing this i thought about it that i could make it save it into a txt file then echo the download link is there any ideas? because to post it to a txt file it would be posting 2 places is there a way to do this? Code:


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