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




Parsing An XML File Into A Table


I'm trying to parse an xml file into a table on a webpage.

I'm using php5 which, I believe, doesn't support xsltproc anymore (since xml support was rewritten for php5).  I have got it working on my home server using xsltproc and an xsl file on the command line (unix) but I want to transfer it to a host which doesn't have xsltproc installed and have the xml file parsed into a table by php because I know it can be done.

The actual page that I'm trying to parse is here

Can anyone give me any pointers/links/howtos for parsing xml files into a table using php?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
File Parsing
I have a file, and I want to start searching it at a certain location, not from the begenning. I use strpos() to find a certain string in the file, and I would like to use a regular expression on the rest of the file after that point returned by strpos().

Parsing A DBF File
I'm attempting to read and parse a DBF file that's been created by an accounting application in place. I'm wondering if anyone can point me to any resources that explain how DBF files are designed. PHP Code:

Parsing A Txt File
I would need a "script" that parses the following information in
'outdoor.txt'.
What i actually need are those variables (for example $yTemp). I'd do it
myself but my knowhow lacks ;D
outdoor.txt is input and variables are "output" which i need to make graphs
(jgraph)

-------OUTDOOR.txt-------
Date; Time; Temp øC
21.11.2003; 18:21:39; -2.69
24.12.2003; 23:10:45; 0.06
01.01.2004; 00:00:29; -5.75
01.01.2004; 00:43:37; -6.13
03.01.2004; 22:13:38; -8.44
05.01.2004; 07:38:58; -4.06
05.01.2004; 09:33:19; -4.50
-------OUTDOOR.txt-------

i know how to read the last line and get three variables:
....
$in_part = explode(";", $lastRow);
$in_pvmOUT = $in_part[0]; // Date = 05.01.2004
$in_aikaOUT = $in_part[1]; // Aika = 09:33:19
$in_lampoOUT = $in_part[2]; // Temp øC = -4.50

But i don't know how to get more values at once and feed it to the array:

Values should be in the following format:
$yTemp = array(-2.69, 0.06, -5.78); // Average temperatures for each month
$xAverage = array("Nov 2003","Dec 2003","Jan 2004");

It actually has values for every minute and every day.
So how should it be done if i want to draw a graph for "today", say
5.1.2004.
$yTempToday =
array(-4.38, -4.44, -4.44, -4.44, -4.44, -4.44, -4.44, -4.50, -4.50, -4.50,
-4.50, -4.44, -4.44, -4.50);
$xTimeDecimal = array(9.40, 9.42, 9.43, 9.45, 9.47, 9.48, 9.50, 9.52, 9.54,
9.56, 9.58, 9.59, 9.61, 9.63);
or $xTimeActual = array("09:23:37", "09:24:42", "09:25:46", "09:26:51",
"09:27:56", "09:29:00", "09:30:05", "09:31:10", "09:32:15", "09:33:19",
"09:34:24", "09:35:29", "09:36:34", "09:37:39");

-------OUTDOOR.txt-------
Date; Time; Temp øC
21.11.2003; 18:21:39; -2.69
24.12.2003; 23:10:45; 0.06
01.01.2004; 00:00:29; -5.75
01.01.2004; 00:43:37; -6.13
03.01.2004; 22:13:38; -8.44
05.01.2004; 09:23:37; -4.38
05.01.2004; 09:24:42; -4.44
05.01.2004; 09:25:46; -4.44
05.01.2004; 09:26:51; -4.44
05.01.2004; 09:27:56; -4.44
05.01.2004; 09:29:00; -4.44
05.01.2004; 09:30:05; -4.44
05.01.2004; 09:31:10; -4.50
05.01.2004; 09:32:15; -4.50
05.01.2004; 09:33:19; -4.50
05.01.2004; 09:34:24; -4.50
05.01.2004; 09:35:29; -4.44
05.01.2004; 09:36:34; -4.44
05.01.2004; 09:37:39; -4.50
-------OUTDOOR.txt-------

PHP Not Parsing All The XML File?
Can some one help me out with this? I am trying to parse this xml file but my code is not parsing the whole file. Code:

Parsing A .doc File
is there a way to get the contents from a .doc file that's readable im using get_file_contents but it's coming out very weird:

     $filename = $renamed_cv;
     $content = file_get_contents("cvs/$filename");
     $cv_for_mysql = mysql_real_escape_string($content);

Parsing A Big Xml File Gives Seg Error
Hi, I'm parsing a *very* big xml file (600MB+) in order to do multiple inserts into a mysql table, but after about 80,000 inserts (5 minutes) I get a seg fault and obviously the script stops. I'm expecting it to get up to around 1 million rows.

The method I'm employing to read the file in follows and then one of my xml_element handlers does the insert, which i didn't bother
showing for the sake of brevity.

<?
# snipped code
function grab_file($parser,$file) {
#<snip>
while($data = fread($handle, 4096)) {
xml_parse($parser, $data, feof($handle));
}
#<snip>
}
$parser = xml_parser_create();
xml_set_element_handler($parser, "start_xml_element", "stop_xml_element");
xml_set_character_data_handler($parser, "character_xml_data");
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
grab_file($parser, $file);
xml_parser_free($parser);
?>

The script itself seems to be working fine as I tested it with much smaller data set and it went like a breeze, so I'm assuming this is coming down to system resources.

Under normal load the box has about 20MB of free memory (64MB max) and about 300MB swap space (400MB+ max). Just before my seg fault, free mem had fallen to less than 1MB and swap space was down to 200MB, the 'size' of the script in ps view was
200MB+

So, when I'm reading this file in, does php not just buffer the 4KB that it's useing for that particular loop? and throw it away when finished? This doesn't seem to be the case, but I'm confused as to how the script can be taking up 200MB, possibly the xml parsing functions are buffering the whole thing?

In short, how can I keep memory useage down (by a large factor)?

File Data Parsing In PHP
Could someone show me how to parse data in a text file using PHP and
store the data in variables and MySQL?

We have text files that contain information that looks something like
this:

EXAMPLE : Elephant
OBJECT : Animal
LOCATION : South Africa
LOCATION : America

EXAMPLE : Water Lily
OBJECT : Plant
LOCATION : Manila

EXAMPLE : Panda
OBJECT : Animal
LOCATION : China

… and so on…

How can I manipulate the data inside a file? The data should be
stored in a MySQL tables considering the relationship of every data
element.

Parsing Stats File
Right now, I have a bunch of stats files from the NHL that are in the format of:

"TYLER ARNASON CHI 3 1 1 2 0 0 0 0 1 0 11 9.1"

Those aren't tabs, they are just a bunch of single spaces.

Now, I want to be able to either a) replace the spaces between each field (not between the first and last name) or b) break each field value down into a variable. Any ideas or tips?

Parsing A Dynamic RSS File
I'm a bit new to PHP, so please bare with me. I've been studying
it for a couple of months now and really like it. On the main page of
my website, I would like to include a small box that lists the title of
the latest blog entry (as well as making that a link to the entry) to
my WordPress blog. I was thinking about parsing the RSS for this, but
I'm not sure how to parse a dynamic RSS feed. Or is there some simpler
way of doing it and I'm trying to overprogram?


Parsing .htaccess File
I want to parse the contents of an .htaccess file from within PHP. The
contents of the .htaccess file looks like this:

<Files foobar.tar.gz>
AuthType Basic
AuthUserFile /foobar
AuthName "Foobar"
<Limit GET>
Require user FOOBAR
</Limit>
</Files>

And so on. When I read in that file with the following code:

$fd = fopen(".htaccess", 'rb');
while (!feof($fd)) {
$line = fgets($fd, 1024);
echo "|".$line."|
";
}
fclose($fd);

Then I get empty lines for those lines containing <Files ...>,
<Limit ...> and so on. How can I get at those lines as well?

What I need to know is basically the information "which user can access
which file?"

Include File Without Parsing It
On my server, what I am planning on doing is having users be able to upload their own HTML files, image files etc etc -- and then... (long story short) be able to have my own self-contained "virtual" web hosting, where the users get a certain amount of space to use.

Their files would therefore be uploaded like regular files, right onto the filesystem; this is fine, except I don't want these users to have access to PHP in their files (which comes inevitably if they have their files on the filesystem). My web host has it enabled to where .html files are processed in PHP (I have to have it this way anyway, because my whole site is using PHP with .html extensions).

My solution to restricting my users files from having access to PHP is by using tricky .htaccess and Not Found pages -- to when a request comes up for URL for example, it will call my Not Found script. The Not Found page will locate the user's file (which is located in a separate folder) and transparently "include()" the requested file, not parsed by PHP.

So, inevitably it comes to this: is there some way that I can use some tricky functions (preferrably string functions, they're quicker, but if all else fails: regular expressions) to scan the requested user file before it is outputted and remove all <? and <?php and <SCRIPT LANGUAGE="php"> in the file.

Parsing XML File Out Of Memory?
What I'm doing is the following:
- Load XML data a file
- Parsing the XML data
- Printing some parsed content

The problem is that the script execution is stopping before all the
content is parsed and printed.
Maybe the PHP is out of memory after a while. That would make sense
since the XML file is about 2 MB.

Parsing Text File
I'm working with a text file that contains the names of websites and their corresponding URLs in the following fashion: <a href="www.cnn.com">CNN News</a>
Each site and title is separated by line breaks. I'm not very experienced with fopen, fread, etc. and was wondering if anyone could give me pointers on how to go about reading the text file line by line and saving the URL and title in separate columns in a database.

Oh, and one more thing. The categories of these sites are also included every so often. I was hoping to save the category in a third field. Ex:

News ( new line here)
<a href="www.cnn.com">CNN News</a> ()
<a href="www.bbc.com">BBC News </a> etc.

Parsing XML Feed Without File Functions
I've written a php script to parse a remote XML file. This works fine on my test server however, the chap I've written the script for is using a hosting service which has disabled the file functions. Is there any way of parsing the xml file without access to the File or Curl functions?

Script is below:

if (!($fp=@fopen("http://server/xmlfeed.xml", "r"))) die ("Couldn't open XML.");
$count=0;
$element=array();
$state=''

function startElementHandler ($parser,$name,$attrib){
global $count;
global $element;
global $state;

switch ($name) {
case $name=="SELECTION" : {
$element[$count]["child1"] = $attrib["child1"];
$element[$count]["child2"] = $attrib["child2"];
$element[$count]["child3"] = $attrib["child3"];
$element[$count]["child4"] = $attrib["child4"];
$element[$count]["child5"] = $attrib["child5"];
break;
}
default : {$state=$name;break;}
}
}

function endElementHandler ($parser,$name){
global $count;
global $element;
if($name=="SELECTION") {$count++;}
}

function characterDataHandler ($parser, $data) {
global $count;
global $element;
}

if (!($xml_parser = xml_parser_create())) die("Couldn't create parser.");
xml_set_element_handler( $xml_parser, "startElementHandler", "endElementHandler");
xml_set_character_data_handler( $xml_parser, "characterDataHandler");

while( $data = fread($fp, 4096)){
if(!xml_parse($xml_parser, $data, feof($fp))) {
break;}
}
xml_parser_free($xml_parser);

Encoding Problem - Parsing An Xml File
I have a problem while parsing an xml file. The file is a backup from moodle (moodle.xml). When i open the file with one of my editors and setting Encoding to utf8 font courier standard or greek characters the editor can see all greek strings contained within the file perfectly. On the other hand when i try to open it with php parse it and then display it on a web page the data from the file come out like latin characters like (A~ atilde)(o: o umplaud) and others
like this. Updating moodle is not an option so i have to find a workaround. Has anybody heard of something like this?

Parsing CSV-file And Adding CSS To Style
I'm parsing a CSV-file into a table on a webpage - and I'd like to be
able to change the alignment for the _last_ <td> in each <tr> - but, as
the file is today, it's not possible for me to assign a CSS-class on
only the last <td>. I was wondering if anyone could give me a clue as to
what I need to change in the following code, to make this possible (I'm
assuming I need to have each <td> present in the code, so as to be able
to assign a class to the last one, but how? I can tell as much as that I
know the number of <td>'s in each CSV-file - they are a constant).

Here is the code:

<?php
class csv{
/* This class builds a html table from the contents of a CSV file. */

var $html = ''

function csv($csvFile){
if(!$csvHandle = fopen($csvFile, 'r')){
$this->html .= "Couldn't open $csvFile.";
}
else{
$this->html .= "<table id="dusjkabinetter">
<thead><tr>

<th id="th2" valign="top" align="left">Prod. nr:</th>

<th id="th3" valign="top" align="left">Bilder:<br />(klikk
for større visning):</th>

<th id="th4" valign="top" align="left">Beskrivelse:</th>

<th id="th5" valign="top" align="left">Pris:</th>

</tr>

</thead>
";
while(($row = fgetcsv($csvHandle, filesize($csvFile))) !== false){
$this->html .= "<tr>";
foreach($row as $field){
$this->html .= "<td>$field</td>";
}
$this->html .= "</tr>
";
}
fclose($csvHandle);
$this->html .= "</table>

";
}
}

function getHtml(){
return $this->html;
}
}

echo <<<TABELL_START
<div class='t_tabell'>
TABELL_START;

$html .= "<h2>Dusjkabinetter</h2>
";
$mycsv = new csv('csv-filer/dusjkabinetter.csv', ' ');
$html .= $mycsv->getHtml();

echo $html;

echo <<<TABELL_SLUTT
</div>
TABELL_SLUTT;
?>

Skip First Line When Parsing An Xml File
I have an xml file which I cant change, the problem is that the
first line looks like this <?xml version="1.0" ?> with the rest of
the xml being fine. However when I try to parse this I am getting a
malformed xml error. THis line was added recently, the parser worked
before. My question is how can I get rid of this first line in the
xml file - which I get from an internet feed using
fopen("http://dsfsf.com/sdf.xml", r);

Parsing An Mbox File Without Imap?
I have an mbox mailbox on a linux server that I need to open and
parse, message by message, looking for content via PHP. However, for
whatever reason, my hosting provider has not compiled PHP with IMAP
support.

Does anyone have anything written that I can download and use (free
would be nice, heh) to parse my mailbox looking for keywords and
delete/expunge/forward/autoreply based on what I find?

Doesn't need to be super fast for processing speed as I'm the only one
using it and wil only run it once or twice per day on a few MB of
Email. I just don't want to reinvent the wheel if someone out there
has what I'm looking for.

Parsing Out A File Using Special Characters
I am creating a site where someone would enter data into a few text boxes, with the potential for them to be fairly long.  I am therefore saving them into a text file instead of a database. 

With these, there is a potential for someone to use the enter key in these boxes, therefore making it very difficult to just parse it out by line. I am currently trying to figure out how to parse it by special characters (or groups of characters such as "%%$$%%" or something that noone would ever type, on purpose or by accident) 

I was wondering if there was a way to parse this out by these special characters, or if there was a way to save those line returns that the people enter as something other than a line return.

Accessing CSV File For PHP Parsing From Remote Server
What function can I use to grab a .csv file from a remote webserver for
use in my PHP script. I want to do some parsing and statistical
analysis on it (server side).

What PHP function is used for this? I can't seem to find it in Google
or the online PHP manual, because I don't really know what keywords to
use.

.htaccess - Parsing A PHP File With A .html Extension?
Can I use .htaccess to parse a PHP file with a standard .html extension?? This doesn't seem to work:

AddType text/html .html
AddHandler server-parsed .html

I'm using a remote host, so modifying the server's .conf file isn't really an option nor is modifying the php.ini file.

Parsing Ascii File Into Multi Dim. Array
I am trying to load a txt file into a multidimensional array. Eech line in the txt file has 3 fields, delimited by a | i.e.

field1|field2|field3
field1|field2|field3
...

This is the code I have right now that adds each line to an array PHP Code:

Domxml - Parsing An Xml File Once Per Session Rather Than Every Time
I am working on an embedded system. The entire configuration for the
system is stored in an XML file, which is pretty long.

It takes about 3 seconds to open the file using domxml_open_file.

Breaking the file into smaller files is not possible; a single XML file
is a part of the design requirement.

Right now we're opening and freeing the file every time any data is
requested from the file, which is quite often. This means that the user
ends up waiting about 5 seconds total before the page is generated.

It would be nice if we could open the file once per session, and keep
the file open throughout the session, rereading only when the file on
disk changes.

Parsing A RSS Feed And Generating A Static .html File With PHP
I have this small project for my site, if you can't point me to some resources or help me out I'll thank you very much.

The homepage of my site points to the different services I offer (chats, forums, my blog and a podcast for spanish speakers). I want to make this homepage more dynamic, but since the homepage gets more than 10000 daily unique visitors I don't wanna make it a .php file ('cause my hosting provider might get mad with the server's resources).

So what I need is to program a php script that I would run on-demand (probably 1 or 2 times a day) and that would make this:

- Parse the RSS feed of my blogs and the forums
- Generate a static .html file (the homepage) with the normal content plus the headlines from the feeds.

That way everytime I update my blogs I could run that php script to re-generate the homepage, with the updated info from the feeds.

Any help, suggestions, comments, links on how to do this will be very helpful. I'm not very experienced with PHP (I come from J2EE development), but I'm armed with 2 PHP books as a reference.

Table To File
How do you transfer data from a MySQL table into a file(text or other viewable type), using PHP?

How To Output From File Into Table?
I have this bit of code that opens a file, reads it line by line, and
prints the filename into an image on screen, so i get a big list of
images on the page.

However I want it to output into a table so I can have 2 photos side by
side as it goes through, is there any way of manipulating the code to
output one line into one cell and the next line into the next cell then
back to the first cell again???

<?
$data = file('gallery/captions');

foreach ($data as $line)
{
list ($q, $a) = explode('|' , trim($line) );
echo "<img src='gallery/images/$q' height=100><br>";
echo "$a<br>";
}

?>

Mysql Table Vs Log File
I have been doing some searching for  a tutorial on creating a simple tracking script to attach to each of my pages.  The tutorials that I found are using a log.txt file instead of a mysql database.  can anyone explain why not use a mysql database

Table To File Swap
I have been working on a form to input information into a mysql table along with the files. I would like to however put the files into a seperate folder on the server. 

Here is my code which I have been assisted with already but cannot figure out how to change it to send the actual file to a seperate folder but still keep the information linked so I can recall the file later based on a search of the information in the table. Code:

Import CSV File Into Database Table
Are there any programs like phpmyadmin, that allow you to import CSV files without first converting them into mysql statements? mysql front?

I've created the table and fields, and it should be easy enough to import the data into its respective columns.

Create A Table Regarding A Text File
I have this .txt file :

Roger|tow25$rank259
Isabelle|tow36$rank24
Pascal|tow12$rank29
Sergeï|tow45$rank5
Michel|tow1245$rank45478
Frédéric|tow1$rank125425

And this programm php3
<?php
$fichier = "classeur.txt";
if($fp = fopen($fichier,"r")){
$ligne=1;
echo "<table border=1 bordercolor="#00CCFF" width=500>
";
echo "<tr align=center><td colspan=3>TITRE</td>";
while (!feof($fp)) {
list( $name, $tampon ) = explode( "|tow", $fp );
list( $tow, $obj ) = explode ( "$rank", $tampon );
echo " <tr>";
echo "<td
align=center><b>Nom".$name."</b></td><td>Tow".$tow."</td><td>Obj".$obj."</td[color=blue]
>";[/color]
echo "</tr>
";
$ligne++;
echo "</table>
";
echo "$cell";
fclose($fp);
}else{
echo "Error : open impossible ".$fichier;
exit();
}
?>

I would like to past each value of the lines in the tex file, in 3 variables
$nom; $tow; $obj
and create a table with 3 column ( column 1 the name, in 2 the tow, and in 3
the obj)

How To Apply Css To A Table That Is The Only Item In A Php File Please
How to apply css to a table that is the only item in a php file please

In the page that has just the one table that is to
be included in the other 2 pages, there's some
heavy css going on, plus the text in the table
gets changed quite a lot on a daily basis.
Usually, in my program, I can highlught the text
that needs a different css applied to it and click
on the css style that applies to it, but because
the page only has the one table and nothing else,
there's no mention of the link to the styles page?

Tab Delimited Txt File To Php Html Table
Wouldn't you know that when I finally find a tutorial using Google that does exactly what I want, the code doesn't run when I use it ...

However, when it gets to this line, for ($i=0; $i<td>$line[0]</td>, it chokes on one of the '>'.

Since my php skills are very basic, and in no way include arrays, can someone assist me with this?

If it's easier to do it differently, what I'd like to do is create a table in Excel/Access, export it to the server (to a tab-delimted text file, since I'll be using commas in my table cells), and have it display in an HTML table.

If I can't figure this out, I'm tempted to just export to HTML from one or the other program (not sure quite yet which I would use), so ...

Populating Table With Text File
My web hosting service uses phpMyAdmin and at the bottom of the screen
iis an area where I can upload a text file to populate a table.

I have a table named groups with two fields:
groups_idauto-increment primary
groups_name

So how do I create my text file to populate this table?

I'm going to use MS Notepad.

If it's set to auto-increment, do I need to include the number? If
so, does it start at 0 (zero)?

Would the file look like:

0,students
1,faculty
2, staff

or just

students
faculty
staff



Create A Table In MySQL From A .php File
Is it possible to create a mySQL table from a .php file? If so how?

Place File Contents Into Table On Page
Hi all. Am new to PHP and trying to get the following to work. I dont know if it is possible at all, and would appreciate any help.

I have a folder called Books. It contains an htm page called books.htm which has some graphic elements on it. It also contains a file (either excel or csv, or tab delimited.... whichever will work best in this situation). This file contains two columns. 1st colums-1st row contains an image name (e.g. alice.gif). And the 2nd column-1st row contains a text discripition (e.g. Alice in Wonderland....bla bla..). And so on for the next rows. The folder also contains the actual 'alice.gif' and all images that are listed in the 1st column.

What i am trying to achive is thus:-
When the books.htm page is called. I want the table in the file to be recreated on the page under the existing graphic elements. In that table, instead of the image names in the first column, i want the actual image (which is present in that folder), to be planted there in that specific cell on the htm page!

Downloading File Stored In Mysql Table Through Ssl
I have a table where I store some binary data. To retrieve this
information as a downloadable file, I use the following code:

header('Content-Type: $mimeType');
header("Content-length: $size");

// for filename, i store the filename in the table, so this does not
actually
// point to a physical file name on the file system
header("Content-Disposition: attachment; filename=$fileName");
header("Content-Description: PHP Generated Data");
echo $data;
return true;

If I go through a normal port (http), the file downloads no problem.
When I try this through ssl (https), I get the following error:

'Internet Explorer cannot download / from 192.168.0.9.'

Through port 80, the filename is set correctly. Through ssl, the
filename doesn't seem to be getting set. Is there a problem with
using 'Content-Disposition: attachment' through ssl?

Updating Passwords In A Table By Reading A File
I wrote a loop that reads a csv file which contains passwords for users in a table. and when I run my script, it reads the file fine and updates the passwords next to the appropriate user but it adds two little squares behind the passord. for example, password[][].  it looks something like that. does anybody know why this is? array for storing the values

Multiple Table Insert From Tab Delimited File
I have a page I'm coding for batch updates from a tab delimited file. Each row has data that has to be checked against and inserted/updated on different tables in my mySQL database.

How would I go about parsing through the tab delimited file and then storing data between the tabs in order to insert individually into separate tables??

Here's what I have so far...

$contents = file('/myfile.txt');

for ($i=0; $i<sizeof($contents); $i++) {

$line = trim($contents[$i]);
$arr = explode(" ", $line);

$line[$i] = array('ID' => $arr[0], 'Record_Type' => $arr[1], 'First_Name' => $arr[2], 'MI' => $arr[3], 'Last_Name' =>
$arr[4], 'Firm' => $arr[5], 'Address' => $arr[6], 'type' => rtrim($arr[13]));

I need to take the different columns.. ID, Record_Type, etc. and update different tables with each value where the IDs match.

Using Php To Move Rows From Text File Into Mysql Table
Can anyone point me in the right direction for the way to read a text file a
line at a time and separate the fields on that line and use them as data in
an INSERT to add a record to a mysql table. Then read the second line in
text file and repeat.

How To Populate HTML Table From Local Text File.
I am looking for a way to populate an HTML table from an external
local text file which looks like this:

DATE/TIME LAT. LON. DEPTH. ML.
-------------------- ---------- ---------- ------- -------
21/03/2005-04:06:03 XX,XX XX,XX 171 3,42
21/03/2005-12:23:53 XX,XX XX,XX 500 5,4
21/03/2005-12:43:10 XX,XX XX,XX 553 5,38
21/03/2005-18:47:51 XX,XX XX,XX 162 3,91
21/03/2005-19:29:49 XX,XX XX,XX 500 3,51
21/03/2005-20:04:51 XX,XX X,X 75 3,72

The file could have more rows (DATA) that I show here. The file is
provided to me on a daily basis and I have to update a web page daily
with the contents of the file.

I considered using JavaScript embedded in the HTML page but I am a
newbie on what scripting for the web it refers.

How can I populate the HTML table with this text file which changes
everyday.

Also, is it possible to use php client-side only, without a server?

Read Data From A Table In Pdf File And Store It To Database
I have to populate MySQL database where data will come from a PDF file. This PDF file has a well formatted table and I have to make a similar replica of the table data into MYSQL Database. Is that possible at all?

Create A Button To Export A Mysql Table To An Excel File.
Does anyone have the code that creates a link, and on click, takes a specified table in my database and exports and downloads an excel file?

Importing A Flat Pipe Delimited File Into A MySQL Data Table
I have done this in perl but eeew I don't want to use perl anymore. I
want to be able to take a flat file that looks like this:

mbriones@...|Marian|Briones
bobsmith@...|Bob|Smith
janedoe@...|Jane|Doe
(etc)

The table has more than 3 fields, so I'd want to process the flat file
and then do an INSERT into mailinglist SET field=$value for each line.

Does someone have a nice way for me to do this? The flat file will be
uploaded to the server via a form (copy) and then be processed.

Grab Content From HTML Table And Place Into MySQL Table?
I am in the process of helping a co-worker upgrade some of his old static html pages into dynamic MySQL driven pages. He currently has a lot of pages with huge tables displaying data. Does anyone know if there is a script or class that can convert a table to a .sql file for upload?

Table Background Color Based On Results From MySQL Table
I am trying to get the "Did User Agree" field on a database query to be colored Green for "Agreed" Red for "Disagreed" and Blue for "Agreed (2nd Time)" .. I have my PHP setup to do the query just fine as of right now with alternating column colors, just can't seem to get the colors to work as I am hoping for.  Can anyone help me get the Agreed? table's background color to the colors above? Code:

Outputting A Table Or Form Using SHOW FIELDS FROM Table
In the code the MySQL database was queried using "SHOW FIELDS FROM table" which and the returned results of column names was then use to build an output for a form and a table with php using a series of if statements along the lines of if the returned field name matches something echo a text input field.

I have never seen this done this way before, so I want to get the opinion of the devshed user. Does it seem like an unsual long process to build up a form. Is there a security advantage doing it this way? Has anyone ever done it this way before?

Finding Matches In A Table And Then Moving That Match To Another Table?
Ok, I have a database that has a table called critiera in this table
is to fields on is ID and the other is critiera.

Now I want to filter out all the one that don't apple to the list and
move the one that match to a different database.

I know how to open a connection, close, select

but I don't know how I would inside of a database use another one as
the way to create the list of critieras....

Mysql Fetch_field Gets Table Alias, Not Real Table Name
After a SQL 'select .... from tablename alias'
the mysql_fetch_field function returns a value $result=>table which
will contain the alias, not the actual table name.
Is there a way to get the actual table name ?

I am running mysql 4.1 and php 4.4

Grab Data From A Table, Echo, Then Insert It Into A New Table...
I'm trying to do is count the number of times usernames shows up in a table. I then want to reinsert that information into a different table with the Username in column1 & the occurrences in column2 for every user that is echoed on the page. Code:


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