[PHP-DB] load data infile -- problem

2005-08-18 Thread select.now
Helo everyone ! I find this problem and I think I am close to the solution but ... The question: I need to import a few thousand of record storee in a *.csv file on my local harddisk, with my php application, managing my mysql engine. So, in command line, all works fine, all records are

Re: [PHP-DB] pg_connect gets fatal error

2005-08-18 Thread John DeSoi
On Aug 14, 2005, at 2:16 PM, Jon Crump wrote: I'm guessing you're right, but it's not clear how I could tell. The output from ?php phpinfo() ? doesn't really help much unless I know what to look for. On the one hand it says that DBX support is enabled and PostgreSQL is one of the

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Dwight Altman
Hey, this is my first question. So if you could just reply to say it reached the php-db list, that would be terrific. Of course, answering the questions would be awesome as well. I meant 'Analyze table' and 'the composite key field2 field3 would be unique' - Original Message -

Re: [PHP-DB] load data infile -- problem

2005-08-18 Thread Miles Thompson
I could be 100% wrong on this, but I do not think that a command line statement can be executed through mysql_query() - try exec(). If I remember correctly mysql load data infile ... is not executed from within mysql, but at the command line. (Hint: look at the source for phpMyAdmin and copy

Re: [PHP-DB] load data infile -- problem

2005-08-18 Thread dpgirago
You can definitely do a load file from within the mysql client, so I'd guess you can do it through mysql_query, too. I'm wondering about the semi-colon within the query. Maybe it needs to be escaped, too. David I could be 100% wrong on this, but I do not think that a command line statement

Re: [PHP-DB] load data infile -- problem

2005-08-18 Thread Bastien Koert
is the file sitting on the same server as the db? Are the webserver and db on the same machine? If they are not, and the file uploaded to the webserver, the db sesrver machine won't have access to the file unless you ftp it over... You may want/need to investigate a more php based approach

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Micah Stevens
I think no one answered it because it doesn't make a whole lot of sense. Breaking a condition out into a second SQL statement would force the DB to rescan the table, so it should take longer rather than shorter. There's nothing suggesting that it's doing an internal self-join or other

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Dwight Altman
Thanks for your reply. Here are the results of EXPLAIN: EXPLAIN SELECT field1, field2, andUpToField10 FROM theTable WHERE field2 = 1 OR field1 = 1 OR field1 = 2 ORDER BY field1 ASC idselect_typetabletypepossible_keyskeykey_len refrowsExtra 1 SIMPLE theTable

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Micah Stevens
Okay, well, I guess that EXPLAINS it.. (bad joke.. sorry.) Not being a huge expert on the inner working on MySQL, I'm at a loss to explain why this is happening exactly, but it's clear that MySQL is choosing to do a filesort over 6400 rows with the first statement. This is probably due to

[PHP-DB] Re: load data infile -- problem

2005-08-18 Thread Dan Baker
select.now [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] So, in command line, all works fine, all records are correctly imported. command line code - mysql load data infile 'c:\\datastream\\import\import -into table iport - fields

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Dwight Altman
No change on either variation. I also tried WHERE field2 = 1 OR field1 3 as well as omitting the ORDER BY clause. Regarding INDEX: http://dev.mysql.com/doc/mysql/en/mysql-indexes.html If a multiple-column index exists on col1 and col2, the appropriate rows can be fetched directly. If