Re: [PHP-DB] Extracting data from Arrays in ISAM table
[EMAIL PROTECTED] wrote: I have a table with between 100k and 200k rows. One field, `names`, is populated, in each row, with an imploded array of up to 4 names. I require to create a list of names, without repeats, of all the names in `names` field to use in an html form. Any advise would be appreciated. I have no ideas on how to start. The best option would be to normalise the data by breaking the names out to a separate table. However, if that's not feasible my suggestion is similar to that itoctopus sent, but a bit more memory efficient. Inside the loop getting the records, do the following... foreach (explode(',', $single_result['name']) as $name) $arr_all_names[$name] = 1; Then after the loop, to get an array of the names... $arr_all_names = array_keys($arr_all_names); -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Extracting data from Arrays in ISAM table
I have a table with between 100k and 200k rows. One field, `names`, is populated, in each row, with an imploded array of up to 4 names. I require to create a list of names, without repeats, of all the names in `names` field to use in an html form. Any advise would be appreciated. I have no ideas on how to start. Louise
RE: [PHP-DB] extracting data
Ok, I am lost now, I am just trying to read the documentation on odbc...here is what I have so far. This seems to work...or at least not give any errors. How do I know get to the result set in the select statement to move this data somewhere else? I just want to get the entire result set so I can load it into another db. Thanks, Eddie ? $connect=odbc_connect('mytest','sa', ''); $stmt=odbc_prepare($connect, select * from tablename); $parms=array(sa,); $eddie=odbc_execute($stmt, $parms); //$rc = odbc_fetch_into($eddie, $my_array); ? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 9:55 PM To: SELPH,JASON (HP-Richardson,ex1) Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] extracting data You can actually do this from any machine, although you will need an ODBC driver on the Linux/Mac OS X/Unix side. Another alternative is to dump the .mdb to mysql format and move it over. But ODBC is the way to go. Beginning PHP Databases from Wrox cover this a lot, but you can get started with just a DSN and a basic odbc_connect. Create it as a System DSN - it will cause less problems. If you are on a *nix or Mac OS X, then you will want to tell the PHP script where the files are that contain the DSN (odbc.ini) and the ODBC Driver Manager (libiodbc.so). There are basic examples and explanations in the HOWTO at www.iodbc.org. It's *nix geared, but just remove the putenv()'s at the beninning of the examples and they will work fine. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Virtuoso Universal Server http://www.openlinksw.com/virtuoso/ At 02:27 PM 12/19/2002, SELPH,JASON (HP-Richardson,ex1) wrote: If you are on a windows machine, you can create a DSN to the access file and use odbc from php to connect to it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 12:59 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] extracting data I posted this to the php general list also so forgive me if you are seeing this twice. Can I use php to extract data from an access db? The php script and access db will be local. I will then upload the file to my server. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] extracting data
Andrew is correct about iodbc. As soon as they write an allbase connector I will be all over it. Here is a function I use to facilitate working with odbc function odbc_fetch_into_array($rs) { $result = array(); if (!odbc_fetch_row($rs)) return false; $numfields = odbc_num_fields($rs); for($lpLoop=1; $lpLoop=$numfields; $lpLoop++) { $fieldname = odbc_field_name($rs,$lpLoop); $fieldval = odbc_result($rs,$lpLoop); $result[$fieldname] = $fieldval; } return $result; } It simulates mysql_fetch_array. Usage is similar to mysql. while( odbc_fetch_into_array($eddie)) { $myvar1= odbc_result( $eddit, fieldname1 ); $myvar5= odbc_result( $eddit, fieldname5 ); code for this line of table } As for how to move the data somewhere else? To another odbc? to mysql? where? And do you want to manipulate the data before moving it? Cheers Jason -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 20, 2002 8:17 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] extracting data Ok, I am lost now, I am just trying to read the documentation on odbc...here is what I have so far. This seems to work...or at least not give any errors. How do I know get to the result set in the select statement to move this data somewhere else? I just want to get the entire result set so I can load it into another db. Thanks, Eddie ? $connect=odbc_connect('mytest','sa', ''); $stmt=odbc_prepare($connect, select * from tablename); $parms=array(sa,); $eddie=odbc_execute($stmt, $parms); //$rc = odbc_fetch_into($eddie, $my_array); ? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 9:55 PM To: SELPH,JASON (HP-Richardson,ex1) Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] extracting data You can actually do this from any machine, although you will need an ODBC driver on the Linux/Mac OS X/Unix side. Another alternative is to dump the .mdb to mysql format and move it over. But ODBC is the way to go. Beginning PHP Databases from Wrox cover this a lot, but you can get started with just a DSN and a basic odbc_connect. Create it as a System DSN - it will cause less problems. If you are on a *nix or Mac OS X, then you will want to tell the PHP script where the files are that contain the DSN (odbc.ini) and the ODBC Driver Manager (libiodbc.so). There are basic examples and explanations in the HOWTO at www.iodbc.org. It's *nix geared, but just remove the putenv()'s at the beninning of the examples and they will work fine. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Virtuoso Universal Server http://www.openlinksw.com/virtuoso/ At 02:27 PM 12/19/2002, SELPH,JASON (HP-Richardson,ex1) wrote: If you are on a windows machine, you can create a DSN to the access file and use odbc from php to connect to it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 12:59 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] extracting data I posted this to the php general list also so forgive me if you are seeing this twice. Can I use php to extract data from an access db? The php script and access db will be local. I will then upload the file to my server. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] extracting data
I posted this to the php general list also so forgive me if you are seeing this twice. Can I use php to extract data from an access db? The php script and access db will be local. I will then upload the file to my server. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] extracting data
If you are on a windows machine, you can create a DSN to the access file and use odbc from php to connect to it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 12:59 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] extracting data I posted this to the php general list also so forgive me if you are seeing this twice. Can I use php to extract data from an access db? The php script and access db will be local. I will then upload the file to my server. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] extracting data
You can actually do this from any machine, although you will need an ODBC driver on the Linux/Mac OS X/Unix side. Another alternative is to dump the .mdb to mysql format and move it over. But ODBC is the way to go. Beginning PHP Databases from Wrox cover this a lot, but you can get started with just a DSN and a basic odbc_connect. Create it as a System DSN - it will cause less problems. If you are on a *nix or Mac OS X, then you will want to tell the PHP script where the files are that contain the DSN (odbc.ini) and the ODBC Driver Manager (libiodbc.so). There are basic examples and explanations in the HOWTO at www.iodbc.org. It's *nix geared, but just remove the putenv()'s at the beninning of the examples and they will work fine. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Virtuoso Universal Server http://www.openlinksw.com/virtuoso/ At 02:27 PM 12/19/2002, SELPH,JASON (HP-Richardson,ex1) wrote: If you are on a windows machine, you can create a DSN to the access file and use odbc from php to connect to it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 12:59 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] extracting data I posted this to the php general list also so forgive me if you are seeing this twice. Can I use php to extract data from an access db? The php script and access db will be local. I will then upload the file to my server. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Extracting data from html files into csv
hi all, I have a huge project coming up today where I need to extract a large number of entries from a directory. What I would like to do is use a site ripper [to download each properties HTML file to a local directory on my pc] and then run some sort of extraction on the file to create an excel, or delimited file. 1. All entries have the same basic format 2. Not all fields are present for each Does anyone know of a program to strip this type of data into a xls or cvs file? thanks much, olinux _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]