Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-04 Thread Markus Wolff - NorthClick
Am Donnerstag, den 04.10.2007, 10:53 +1000 schrieb Chris:
  mmh wonder what could possibly be wrong when even trying 777? :-)
 
 Some hosts check for and disable access to files that have wide-open 
 permissions - usually when php is running as a cgi but I've seen it when 
 using mod_php too.

Hi Chris,

I've tried on a number of machines that have been setup either by me or
an admin I know. So I can say with some confidence that this is not the
case here :-)

 If you try something other than 777 what happens? (644 just to see if 
 you can open it, then work on writing to it).

As one would expect, this yields a different exception because the
webserver can't open the database for write access anymore:

PDOException: SQLSTATE[HY000]: General error: 14 unable to open database
file in /home/mwolff/webs/markus/cms/test.php on line 6

 Can you see the file from this script?
 
 $file = dirname(__FILE__) . '/frontend.db';
 echo is_file($file) . 'br?';

Yep.

CU
 Markus

-- 
Mit freundlichen Grüßen
Markus Wolff
Development

NorthClick GmbH

Gasstr. 10 - 22761 Hamburg
Tel.: 040 8 22 44 999 - Fax: 040 8 22 44 998
Internet: http://www.northclick.de/

Geschäftsführer: F. Detzner | M. Henze | C. Springub
Amtsgericht Hamburg, HRB 94459

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-04 Thread Markus Wolff - NorthClick
Am Mittwoch, den 03.10.2007, 20:25 +0300 schrieb Thodoris:
 I came up with this try to edit your php.ini and in case you use
 pdo_sqlite extension then change the order of the loaded modules to
 this:
 
   extension=pdo.so
   extension=pdo_sqlite.so
   extension=sqlite.so

Still no change - and the CLI version of PHP was configured in the same
order as the mod_php version anyway, so there wouldn't be a difference.

 You could also define the full path of the extensions like this:
 
 extension_dir=/usr/local/include/php/ext/pdo/

Actually, the full path seems to be some kind of hardcoded into the
build (at least that's the case with the Debian package of PHP I'm
currently working with), so no point in repeating that in the php.ini.

CU
 Markus

-- 
Mit freundlichen Grüßen
Markus Wolff
Development

NorthClick GmbH

Gasstr. 10 - 22761 Hamburg
Tel.: 040 8 22 44 999 - Fax: 040 8 22 44 998
Internet: http://www.northclick.de/

Geschäftsführer: F. Detzner | M. Henze | C. Springub
Amtsgericht Hamburg, HRB 94459

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread T K
Hi,

I have a form with a button, which adds user inputted data into
database. I've been looking for a way to prevent users from pressing
the same button twice mistakingly.

I've learned that this is possible to make and send a unique id in
hidden input, and check if the id is used before database query is
issued. (PHP Cookbook [O'reilly]).

But, is there a way to make this happen without using database? It
would cool if I could only use HTML/JavaScript/CSS.

Tek.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: [PHP] Re: the opposite of a join?

2007-10-04 Thread Robert Cummings
On Thu, 2007-10-04 at 11:56 +1000, Chris wrote:
 Robert Cummings wrote:
  On Thu, 2007-10-04 at 11:23 +1000, Chris wrote:
  Robert Cummings wrote:
  On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
  This is only from my own personal testing.  Mind you that I have only 
  been using PostgreSQL for a 
  year or so.  But one problem that I have always ran into with MySQL is 
  that when JOIN'ing tables 
  that have large data sets is a PITA.
  Were you doing left joins when you experienced those problems? Left
  joins are usually very fast.
  If indexed properly of course ;)
  
  Yes, but you're not going to get a performance improvement if you use
  anything else if the table isn't properly indexed.
 
 A subselect could win out in terms of performance especially if the 
 table in the subselect is reasonably small (eg all fits into memory).

But if it fits in memory then it's probably already in memory for a left
join also.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread TG

The most common method I've seen is with Javascript.   onsubmit, disable 
submit button.

As a backup, in case the user's JS is disabled, you might consider the unique 
ID thing.

-TG

- Original Message -
From: T K [EMAIL PROTECTED]
To: php-db@lists.php.net
Date: Thu, 4 Oct 2007 20:09:01 +0900
Subject: [PHP-DB] Prevention for multiple submissions from the same form

 Hi,
 
 I have a form with a button, which adds user inputted data into
 database. I've been looking for a way to prevent users from pressing
 the same button twice mistakingly.
 
 I've learned that this is possible to make and send a unique id in
 hidden input, and check if the id is used before database query is
 issued. (PHP Cookbook [O'reilly]).
 
 But, is there a way to make this happen without using database? It
 would cool if I could only use HTML/JavaScript/CSS.
 
 Tek.
 
 -- 
 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] Prevention for multiple submissions from the same form

2007-10-04 Thread Jonathan Gravois
I used the JavaScript method to disable the button after the first click and
discovered from irate customers and administration that this resulted in an
unsubmittable form on the AOL Browser although it worked perfectly in all
others. Just a mention in case your clientele is AOL heavy (like ours).

Jon 

-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 04, 2007 9:06 AM
To: T K; php-db@lists.php.net
Subject: RE: [PHP-DB] Prevention for multiple submissions from the same form


after submit direct the user to a different page...or use js and disable the
button after the first click
 
bastien Date: Thu, 4 Oct 2007 20:09:01 +0900 From: [EMAIL PROTECTED] 
bastien To: php-db@lists.php.net Subject: [PHP-DB] Prevention for 
bastien multiple submissions from the same form  Hi,  I have a form 
bastien with a button, which adds user inputted data into database. 
bastien I've been looking for a way to prevent users from pressing the 
bastien same button twice mistakingly.  I've learned that this is 
bastien possible to make and send a unique id in hidden input, and 
bastien check if the id is used before database query is issued. (PHP 
bastien Cookbook [O'reilly]).  But, is there a way to make this 
bastien happen without using database? It would cool if I could only 
bastien use HTML/JavaScript/CSS.  Tek.  --  PHP Database Mailing 
bastien List (http://www.php.net/) To unsubscribe, visit: 
bastien http://www.php.net/unsub.php
_
Express yourself with new emoticons. It's easy! Try it!
http://www.freemessengeremoticons.ca/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread Bastien Koert

after submit direct the user to a different page...or use js and disable the 
button after the first click
 
bastien Date: Thu, 4 Oct 2007 20:09:01 +0900 From: [EMAIL PROTECTED] To: 
php-db@lists.php.net Subject: [PHP-DB] Prevention for multiple submissions 
from the same form  Hi,  I have a form with a button, which adds user 
inputted data into database. I've been looking for a way to prevent users from 
pressing the same button twice mistakingly.  I've learned that this is 
possible to make and send a unique id in hidden input, and check if the id is 
used before database query is issued. (PHP Cookbook [O'reilly]).  But, is 
there a way to make this happen without using database? It would cool if I 
could only use HTML/JavaScript/CSS.  Tek.  --  PHP Database Mailing List 
(http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php 
_
Express yourself with new emoticons. It’s easy! Try it!
http://www.freemessengeremoticons.ca/

[PHP-DB] MySQL Identifying worst-performing codes

2007-10-04 Thread Lasitha Alawatta
 

Hello friends,

 

There is  a tool call idera (SQL diagnostic manager). Basically it is
a performance monitoring and diagnostics tool. 

It has a feature;  

 

Identifying of worst-performing codes - 

Identifies performance bottlenecks such as the worst-performing stored
procedures, long-running queries, most frequently run queries, SQL
Statements and SQL batches

http://www.idera.com/Products/SQLdm/Features.aspx 

 

 

I'm looking for a same like tool for MySQL. Is anyone have any  ideas.

 

 

Thanks in advance,

 

 

Best Regards,

Lasitha

 

DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for the 
addressee only. If you are not the named addressee you must not disclose, copy 
or take
any action in reliance of this transmission and you should notify us as soon as 
possible. If you have received it in error, please contact the message sender 
immediately.
This e-mail and any attachments are believed to be free from viruses but it is 
your responsibility to carry out all necessary virus checks and DOTW accepts no 
liability
in connection therewith. 

This e-mail and all other electronic (including voice) communications from the 
sender's company are for informational purposes only.  No such communication is 
intended
by the sender to constitute either an electronic record or an electronic 
signature or to constitute any agreement by the sender to conduct a transaction 
by electronic means.
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread Lasitha Alawatta
Hi TK,

Try this,

input type=Submit name=butSubmit value=Submit ?php
if($_POST['butSubmit']=='Submit') {? disabled=disabled ?php }? 



Regards,
Lasitha 



-Original Message-
From: T K [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 04, 2007 3:09 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Prevention for multiple submissions from the same form

Hi,

I have a form with a button, which adds user inputted data into
database. I've been looking for a way to prevent users from pressing
the same button twice mistakingly.

I've learned that this is possible to make and send a unique id in
hidden input, and check if the id is used before database query is
issued. (PHP Cookbook [O'reilly]).

But, is there a way to make this happen without using database? It
would cool if I could only use HTML/JavaScript/CSS.

Tek.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for the 
addressee only. If you are not the named addressee you must not disclose, copy 
or take
any action in reliance of this transmission and you should notify us as soon as 
possible. If you have received it in error, please contact the message sender 
immediately.
This e-mail and any attachments are believed to be free from viruses but it is 
your responsibility to carry out all necessary virus checks and DOTW accepts no 
liability
in connection therewith. 

This e-mail and all other electronic (including voice) communications from the 
sender's company are for informational purposes only.  No such communication is 
intended
by the sender to constitute either an electronic record or an electronic 
signature or to constitute any agreement by the sender to conduct a transaction 
by electronic means.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] RE: [PHP] MySQL Identifying worst-performing codes

2007-10-04 Thread Jay Blanchard
[snip]
There is  a tool call idera (SQL diagnostic manager). Basically it is a 
performance monitoring and diagnostics tool. 
It has a feature;  

Identifying of worst-performing codes - 
Identifies performance bottlenecks such as the worst-performing stored 
procedures, long-running queries, most frequently run queries, SQL Statements 
and SQL batches
http://www.idera.com/Products/SQLdm/Features.aspx 

I'm looking for a same like tool for MySQL. Is anyone have any  ideas.
[/snip] 

Have you thought about asking this on the MySQL list?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread T K
Thank you for answering my question. Can anybody explain a simple
JavaScript only solution? I haven't used JavaScript except for some
copy-and-paste jobs.

Tek

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: MySQL Identifying worst-performing codes

2007-10-04 Thread Colin Guthrie
Lasitha Alawatta wrote:
 There is  a tool call “idera” (SQL diagnostic manager). Basically it is
 a performance monitoring and diagnostics tool.
 
 It has a feature; 
 
  
 
 Identifying of worst-performing codes –
 
 Identifies performance bottlenecks such as the worst-performing stored
 procedures, long-running queries, most frequently run queries, SQL
 Statements and SQL batches

You can just turn on the MySQL option log slow queries and it logs
them for you. Make those more efficient and you've already taken care of
a lot of the low hanging fruit for db optimisation.

Col.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread Bastien Koert

try
 
input type='submit' name='submit' value='Submit' 
onclick='this.style.disabled=true;' /
 
bastien
 Date: Fri, 5 Oct 2007 00:14:44 +0900 From: [EMAIL PROTECTED] To: 
 php-db@lists.php.net Subject: Re: [PHP-DB] Prevention for multiple 
 submissions from the same form  Thank you for answering my question. Can 
 anybody explain a simple JavaScript only solution? I haven't used JavaScript 
 except for some copy-and-paste jobs.  Tek  --  PHP Database Mailing 
 List (http://www.php.net/) To unsubscribe, visit: 
 http://www.php.net/unsub.php 
_
Get cool Messenger Emoticons! Click here to learn more.
http://www.freemessengeremoticons.ca/

[PHP-DB] [PHP] Re: [PHP-DB] Re: [PHP] Re: the opposite of a join?

2007-10-04 Thread John A DAVIS


left join where item in right table is null
 "Chris" [EMAIL PROTECTED] 10/3/2007 10:32:01 PM 
Aleksandar Vojnovic wrote: I would also suggest to limit yourself to things you actually need not  to select the whole table.In this case you can't because you're looking for records that exist in one table that don't exist in another.Apart from looking at the whole table in each case how else would you do that?-- Postgresql  php tutorialshttp://www.designmagick.com/-- PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] Re: the opposite of a join?

2007-10-04 Thread Chris

John A DAVIS wrote:

left join where item in right table is null


That's still going to look at all records in both tables:

1) so it can work out if there is a match from table 1 to table 2
2) so it can then remember to display any records that don't have a match

I was thinking more that if you have something like this:

select * from table1 where id not in (select id from table2);

The db might take that and turn it into:

select * from table1 where id not in (id1,id2,id3);

But it doesn't really matter.

Either way you end up with full table or index scans (depending on the 
db and engine you are using if mysql) of both table1 and table2.


myisam tables might just be able to use an index to do this sort of 
work, innodb will have to do a table scan because it's mvcc (as will 
postgres and others).


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Preparing SQL insert statements from CSV files

2007-10-04 Thread T K
Hi,

I have to parse csv files and put them into database. I was able to
parse the files by fgetcsv() and made an HTML table. But, when it
comes to parse more closely and make INSERT INTO statement, then I'm
having problems with, probably for-loop.

For example, how do you do this task with the simple csv file shown at
https://admin.easymail.rmplc.co.uk/admin_help/csv.htm .

T

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Preparing SQL insert statements from CSV files

2007-10-04 Thread Chris

T K wrote:

Hi,

I have to parse csv files and put them into database. I was able to
parse the files by fgetcsv() and made an HTML table. But, when it
comes to parse more closely and make INSERT INTO statement, then I'm
having problems with, probably for-loop.


Do you need to do anything to the data before it's inserted?

Check out http://dev.mysql.com/doc/refman/5.0/en/load-data.html if 
you're using mysql - it can load a csv file directly (providing it's 
properly formatted etc).


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Preparing SQL insert statements from CSV files

2007-10-04 Thread Bruce Cowin
And if you're using MS SQL Server, you can use BULK INSERT.


Regards,

Bruce

 Chris [EMAIL PROTECTED] 5/10/2007 3:30:13 p.m. 
T K wrote:
 Hi,
 
 I have to parse csv files and put them into database. I was able to
 parse the files by fgetcsv() and made an HTML table. But, when it
 comes to parse more closely and make INSERT INTO statement, then
I'm
 having problems with, probably for-loop.

Do you need to do anything to the data before it's inserted?

Check out http://dev.mysql.com/doc/refman/5.0/en/load-data.html if 
you're using mysql - it can load a csv file directly (providing it's 
properly formatted etc).

-- 
Postgresql  php tutorials
http://www.designmagick.com/ 

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