Re: [PHP-DB] SELECT FROM 2 or more tables

2003-08-21 Thread Brent Baisley
You rarely want to do a join with no filters is what i was trying to 
get at.

On Wednesday, August 20, 2003, at 04:20 PM, Ben Lake wrote:

Rarely want to do joins? That's a new one.

Ben

-Original Message-
From: Brent Baisley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 3:04 PM
To: John Ryan
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
A join merges every record in one table with every record in another
table, which is something you rarely want to do. So you want to set a
filter on the merged records, which can be anything, but is usually a
match between a field in one table and a field in another table.
That's a join in two sentences or less.

On Wednesday, August 20, 2003, at 03:41 PM, John Ryan wrote:

I cant grasp JOIN for the life of me

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
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

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] select and comparison of fields,

2003-08-21 Thread Dave [Hawk-Systems]
looking for a better way to query and cehck for overlapping timeframes.

am selecting records for display that has 3 fields of importance;
date_time (unix timestamp)
session_time (in seconds)
user_id  (text field)

Of all the sessions recorded, we are looking for a count of duplicate sessions
for a given month. currently we are doing this with two seperate calls, but it
is taking forever to process;

# first query is to gather sessions that took place within a given month
$query = "SELECT * FROM logs WHERE name='$username' AND \
date_time>$dategt AND date_time<$datelt \
ORDER BY date_time DESC";
$result = pg_exec($database,$query);
$numrows=pg_numrows($result);
for($count=0;$count<$numrows;$count++){
$row = pg_fetch_array($result,$count);
# as we go through the hits, check for duplicates within that timeframe as well
$DUPquery = "SELECT session_id FROM logs WHERE name='$username' AND \
date_time>$sessionstart AND \
(date_time - session_time)<$datetime \
ORDER BY name ASC, date_time DESC";
$DUPresult=pg_exec($database,$DUPquery);
$DUPcount=pg_numrows($DUPresult);


Obviously this is extremely processor intensive, not to mention it seems sloppy.
Any better recommendations, either on altering the above code, or another way to
get the information we require?

Dave



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



[PHP-DB] DISTINCT not working

2003-08-21 Thread Dillon, John

Any ideas on why the DISTINCT would not work in the following testing code:

$query="CREATE TABLE IF NOT EXISTS temp3TEMP 
SELECT DISTINCTROW ROUND($tbl2.Net*.175,2) AS ExpNet175, 
CONCAT($tbl2.Journal,$tbl2.Description) AS CON175 
FROM $tbl2 
WHERE $tbl2.Dept='$rcc' 
AND $tbl2.Net>0";

$query="CREATE TABLE IF NOT EXISTS temp3 
SELECT DISTINCTROW temp3TEMP.ExpNet175, 
LEFT(temp3TEMP.CON175,2048) AS CON175 
FROM temp3TEMP 
ORDER BY temp3TEMP.CON175"; 

John










































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


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



[PHP-DB] RE: DISTINCT not working

2003-08-21 Thread Dillon, John
Please ignore this question - sorry, it does actually work.  

However, I still have no suggestions on whether I should try to uninstall
Apache 2.0.47 and install the 1.x version to be compatible with PHP.

***previous query***
... while setting PHP/MySQL/Apache up on my computer to try solve this I've
just noticed that PHP is not recommended with the latest verion of Apache.
Should I/can I just uninstall Apache in order to roll it back from the
2.0.47 version to the previous stable 1.x version? I don't see any uninstall
file in the Apache directory...
***

or can I just install the earlier version on my computer as well?

John

-Original Message-
From: Dillon, John 
Sent: 21 August 2003 16:12
To: [EMAIL PROTECTED]
Subject: DISTINCT not working



Any ideas on why the DISTINCT would not work in the following testing code:

$query="CREATE TABLE IF NOT EXISTS temp3TEMP 
SELECT DISTINCTROW ROUND($tbl2.Net*.175,2) AS ExpNet175, 
CONCAT($tbl2.Journal,$tbl2.Description) AS CON175 
FROM $tbl2 
WHERE $tbl2.Dept='$rcc' 
AND $tbl2.Net>0";

$query="CREATE TABLE IF NOT EXISTS temp3 
SELECT DISTINCTROW temp3TEMP.ExpNet175, 
LEFT(temp3TEMP.CON175,2048) AS CON175 
FROM temp3TEMP 
ORDER BY temp3TEMP.CON175"; 

John










































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


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



[PHP-DB] Segmentation fault caused by PHP ODBC

2003-08-21 Thread Tommy Apel
Hi I'm having a little problem ondestanding whats going on
The problem is that some and only some of my odbc_exec()'s functions while
others don't and cause an segmentation fault in apache1/2
My configuration is SuSE 8.1 with Apache2.0.44, PHP4.3.1 --with-iODBC after
that i've added FreeTDS 0.61 as ODBC-driver for MS-SQL2K, now this works
fine some of the way but not always

Exampel:
odbc_exec($conn,"select id,name from $user_db.dbo.users"); // Works fine no
problem

odbc_exec($conn,"select * from $user_db.dbo.users where (id = '$idz')"); //
Does not work and causes seg fault (11)


Can anyone maby help me explain this error

Regards
Tommy

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



[PHP-DB] Segmentation fault caused by PHP ODBC

2003-08-21 Thread Tommy Apel
Hi I'm having a little problem ondestanding whats going on
The problem is that some and only some of my odbc_exec()'s functions while
others don't and cause an segmentation fault in apache1/2
My configuration is SuSE 8.1 with Apache2.0.44, PHP4.3.1 --with-iODBC after
that i've added FreeTDS 0.61 as ODBC-driver for MS-SQL2K, now this works
fine some of the way but not always

Exampel:
odbc_exec($conn,"select id,name from $user_db.dbo.users"); // Works fine no
problem

odbc_exec($conn,"select * from $user_db.dbo.users where (id = '$idz')"); //
Does not work and causes seg fault (11)


Can anyone maby help me explain this error

Regards
Tommy

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



[PHP-DB] cancel of <20030821160143.36029.qmail@pb1.pair.com>

2003-08-21 Thread Tommy Apel
cancel by original author

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



Re: [PHP-DB] Need For SPEED

2003-08-21 Thread Ignatius Reilly
Sorry I don't seem to get it.

1. What is"the import function provided in PHPList" ?
2. What do you mean by "initialize each data record " ?

Ignatius
_
- Original Message -
From: "Creigh Shank" <[EMAIL PROTECTED]>
To: "Ignatius Reilly" <[EMAIL PROTECTED]>
Sent: Thursday, August 21, 2003 7:26 PM
Subject: Re: [PHP-DB] Need For SPEED


> Thanks.  We're using the import function provided in PHPList.  Looked at a
> more direct method, but we need to properly initialize each data record in
> the database.
>
> Sorry about the cross-posting.  Not sure which list can help.
>
> Creigh
>
> At 07:13 PM 8/21/2003 +0200, you wrote:
> >What is your data load method? What is the type of your table(s)?
> >
> >With LOAD DATA and text files, I load several million rows in about a
> >minute.
> >
> >Also please don't cross-post. Better first find out what the most
suitable
> >mailing list is.
> >
> >Ignatius
> >_
> >- Original Message -
> >From: "Creigh Shank" <[EMAIL PROTECTED]>
> >To: "MySQL Users" <[EMAIL PROTECTED]>; "PHP-db List"
> ><[EMAIL PROTECTED]>; "PHPList Users" <[EMAIL PROTECTED]>;
> >"Michiel Dethmers" <[EMAIL PROTECTED]>
> >Sent: Thursday, August 21, 2003 6:58 PM
> >Subject: [PHP-DB] Need For SPEED
> >
> >
> > > Using an Apache/PHP/MySQL/Linux (Redhat 8.0) solution, PHPList, to
create
> > > an e-mailing list for our 5.6 million book club members.
Unfortunately,
> > > the import speed for importing records (at record number 150,000 the
rate
> > > is about 2,000 records per hour).  We're running on the following:
> > >
> > > P4 (1.5 Ghz), 1.2 Gbytes RAM (650 Mbytes RAM Disk using ramfs), IDE
drive
> > > (72,00 rpm)
> > >
> > > So far we've moved the MySQL data files (var/lib/mysql), PHP /tmp and
> > > upload directories and PHPlist web site files to RAM Disk (still just
> > > testing - not yet dealing with data safety issues).  With all of this
> > > tuning we're still at only 2,000 records per hour for uploading.
> > >
> > > We need to be at 100,000 records per hour (uploading and sending seem
to
> > > run at about the same rate - we need to be able to send to all book
club
> > > members in the same week).  Any suggestions?
> > >
> > > Creigh
> > >
> > > (We're planning to run the system on a server with dual Opterons, 8
Gbytes
> > > RAM and RAID-5 SCSI drives, but I don't think the additional system
> > > horsepower will solve our problem.)
> > >
> > >
> > > --
> > > 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] Segmentation fault (11) with PHP ODBC

2003-08-21 Thread Tommy Apel
Hi I'm having a little problem ondestanding whats going on
The problem is that some and only some of my odbc_exec()'s functions while
others don't and cause an segmentation fault in apache1/2
My configuration is SuSE 8.1 with Apache2.0.44, PHP4.3.1 --with-iODBC after
that i've added FreeTDS 0.61 as ODBC-driver for MS-SQL2K, now this works
fine some of the way but not always

Exampel:
odbc_exec($conn,"select id,name from $user_db.dbo.users"); // Works fine no
problem

odbc_exec($conn,"select * from $user_db.dbo.users where (id = '$idz')"); //
Does not work and causes seg fault (11)


Can anyone maby help me explain this error

Regards
Tommy

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



[PHP-DB] Error updating db when using a '

2003-08-21 Thread Aleks @ USA.net
I have a strange problem I am adding records into a MySQL db... there is
a description
column and everything works fine when I add a new record. When I try to edit
an existing
record it fails if I us an apostrophe ['] in the field. I thought that
addslashes would take care
of this but it is not working. Here is the code


// Troubleshooting section Prints out the inform received from the form

echo  (" Output received from form ");
$A =   $_POST['DID'];
echo("$A"); //<- For Troubleshooting

$B =   $_POST['DocName'];
echo("$B"); //<- For Troubleshooting

$C =   $_POST['Location'];
echo("$C"); //<- For Troubleshooting

$D =   $_POST['DocDescrib'];
echo("$D"); //<- For Troubleshooting


// Add slashes to preserve proper formatting in db

 $DID = addslashes($A);
 $DocName = addslashes($B);
 $Location = addslashes($C);
 $DocDescrib = addslashes($D);

// SQL used to update the record

// Updates Existing Record
 $sql = ("UPDATE MySQL_dB
  SET ModDate=CURDATE(), DocName='$DocName',  DocDescrib='$DocDescrib',
Location='$Location' where DID='$DID'");

If I do not use the apostrophe in the DocDescrib field this works fine. The
min I introduce one, I get the following error:

Error adding new Data: you have an error in your SQL syntax near 's

Thanks in advance for your assistance...

Aleks


RE: [PHP-DB] Error updating db when using a '

2003-08-21 Thread Hutchins, Richard
The only thing I see in your code that looks a bit odd are the parens around
your sql statement. I'm not saying that they're causing the problem, just
that I've not seen them used in that manner before.

May I suggest that you echo out the $sql statement to the browser? Then copy
and paste all of the output from this script back to this list. You may
actually figure out what the problem is simply be echoing the $sql back to
the browser though.

Rich

> -Original Message-
> From: Aleks @ USA.net [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 21, 2003 2:38 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Error updating db when using a '
> 
> 
> I have a strange problem I am adding records into a MySQL 
> db... there is
> a description
> column and everything works fine when I add a new record. 
> When I try to edit
> an existing
> record it fails if I us an apostrophe ['] in the field. I thought that
> addslashes would take care
> of this but it is not working. Here is the code
> 
> 
> // Troubleshooting section Prints out the inform received 
> from the form
> 
> echo  (" Output received from form ");
> $A =   $_POST['DID'];
> echo("$A"); //<- For Troubleshooting
> 
> $B =   $_POST['DocName'];
> echo("$B"); //<- For Troubleshooting
> 
> $C =   $_POST['Location'];
> echo("$C"); //<- For Troubleshooting
> 
> $D =   $_POST['DocDescrib'];
> echo("$D"); //<- For Troubleshooting
> 
> 
> // Add slashes to preserve proper formatting in db
> 
>  $DID = addslashes($A);
>  $DocName = addslashes($B);
>  $Location = addslashes($C);
>  $DocDescrib = addslashes($D);
> 
> // SQL used to update the record
> 
> // Updates Existing Record
>  $sql = ("UPDATE MySQL_dB
>   SET ModDate=CURDATE(), DocName='$DocName',  
> DocDescrib='$DocDescrib',
> Location='$Location' where DID='$DID'");
> 
> If I do not use the apostrophe in the DocDescrib field this 
> works fine. The
> min I introduce one, I get the following error:
> 
> Error adding new Data: you have an error in your SQL syntax near 's
> 
> Thanks in advance for your assistance...
> 
> Aleks
> 

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



RE: [PHP-DB] Error updating db when using a '

2003-08-21 Thread Aleks @ USA.net
Found the problem.. seems that spanning the sql statement with a carriage
return messed something up. It works fine now..

Sorry about the return receipt earlier... won't happen again..

Thanks

Aleks

-Original Message-
From: Aleks @ USA.net [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Error updating db when using a '


I have a strange problem I am adding records into a MySQL db... there is
a description
column and everything works fine when I add a new record. When I try to edit
an existing
record it fails if I us an apostrophe ['] in the field. I thought that
addslashes would take care
of this but it is not working. Here is the code


// Troubleshooting section Prints out the inform received from the form

echo  (" Output received from form ");
$A =   $_POST['DID'];
echo("$A"); //<- For Troubleshooting

$B =   $_POST['DocName'];
echo("$B"); //<- For Troubleshooting

$C =   $_POST['Location'];
echo("$C"); //<- For Troubleshooting

$D =   $_POST['DocDescrib'];
echo("$D"); //<- For Troubleshooting


// Add slashes to preserve proper formatting in db

 $DID = addslashes($A);
 $DocName = addslashes($B);
 $Location = addslashes($C);
 $DocDescrib = addslashes($D);

// SQL used to update the record

// Updates Existing Record
 $sql = ("UPDATE MySQL_dB
  SET ModDate=CURDATE(), DocName='$DocName',  DocDescrib='$DocDescrib',
Location='$Location' where DID='$DID'");

If I do not use the apostrophe in the DocDescrib field this works fine. The
min I introduce one, I get the following error:

Error adding new Data: you have an error in your SQL syntax near 's

Thanks in advance for your assistance...

Aleks



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



[PHP-DB] Browser timing out.

2003-08-21 Thread J. Michael Roberts
Okay, I'm going mildly crazy now.

I've got a huge query that runs and does all sorts of things...but the
problem is that it's taking longer than the proxy server will allow to
generate the HTML, thus the browser (IE) reports a timeout.

I've successfully executed the entire script using Netscape, but Netscape
appears to be a little more forgiving with it's buffer size than IE does.

I've tried using a flush() call, but the output that is displayed to the
user is fairly small in comparasion to all the stuff that's going on in the
background.

Is there a way to get IE to display the data it has received on the fly?  If
not, is there a way to force IE (and netscape) to use a smaller buffer size?
I've thought about filling up the output buffer with some hidden garbage,
but that would just be silly.

Any thoughts would be greatly appreciated.

--JMR




Re: [PHP-DB] Browser timing out.

2003-08-21 Thread colbey
Perhaps change it to an offline report?  I've done that in the past, it
get's scheduled or backgrounded and the results are either emailed to the
person, or generated report stored in the database for quick load later on
(user gets email that report is ready for viewing)..




On Thu, 21 Aug 2003, J. Michael Roberts wrote:

> Okay, I'm going mildly crazy now.
>
> I've got a huge query that runs and does all sorts of things...but the
> problem is that it's taking longer than the proxy server will allow to
> generate the HTML, thus the browser (IE) reports a timeout.
>
> I've successfully executed the entire script using Netscape, but Netscape
> appears to be a little more forgiving with it's buffer size than IE does.
>
> I've tried using a flush() call, but the output that is displayed to the
> user is fairly small in comparasion to all the stuff that's going on in the
> background.
>
> Is there a way to get IE to display the data it has received on the fly?  If
> not, is there a way to force IE (and netscape) to use a smaller buffer size?
> I've thought about filling up the output buffer with some hidden garbage,
> but that would just be silly.
>
> Any thoughts would be greatly appreciated.
>
> --JMR
>
>
>

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



Re: [PHP-DB] Browser timing out.

2003-08-21 Thread J. Michael Roberts
unfortunately, it's not something that can be offline.  What's actually
happening is the database is being queried for information that allows the
PHP script to find data files to be sent to the printer.  The query really
isn't the problem, it's the sending of data when there is ALOT of data being
sent.  Being that the actual data sent to the browser is minimal, both IE
and Netscape wait until there is something worth printing before it renders
the output.

Basically, I need a way to force IE and Netscape to render the output so
that the user doesn't get a timeout notification.

--JMR

[EMAIL PROTECTED]   wrote:


Perhaps change it to an offline report?  I've done that in the past, it

get's scheduled or backgrounded and the results are either emailed to the

person, or generated report stored in the database for quick load later on

(user gets email that report is ready for viewing)..









On Thu, 21 Aug 2003, J. Michael Roberts wrote:



  

Okay, I'm going mildly crazy now.



I've got a huge query that runs and does all sorts of things...but the

problem is that it's taking longer than the proxy server will allow to

generate the HTML, thus the browser (IE) reports a timeout.



I've successfully executed the entire script using Netscape, but Netscape

appears to be a little more forgiving with it's buffer size than IE does.



I've tried using a flush() call, but the output that is displayed to the

user is fairly small in comparasion to all the stuff that's going on in the

background.



Is there a way to get IE to display the data it has received on the fly?  If

not, is there a way to force IE (and netscape) to use a smaller buffer size?

I've thought about filling up the output buffer with some hidden garbage,

but that would just be silly.



Any thoughts would be greatly appreciated.



--JMR











  





Re: [PHP-DB] Browser timing out.

2003-08-21 Thread colbey

Look at using server side compression, mod_Gzip or similar, PHP4.something
also has compression handler built in.. When dealing with compressing raw
HTML pages, very high compression levels can be reached..

Snippit from my mod_gzip+apache+php logs:

ip.ip.ip.ip - - [21/Aug/2003:17:17:01 -0400] "GET / HTTP/1.1" 200 3450
"http://referrer"; "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.0; Hotbar 4.3.1.0)" mod_gzip: DECHUNK:OK In:15234
Out:3450:78pct.

^^  78% compression can cut data transfer down pretty quick!



On Thu, 21 Aug 2003, J. Michael Roberts wrote:

> unfortunately, it's not something that can be offline.  What's actually
> happening is the database is being queried for information that allows the
> PHP script to find data files to be sent to the printer.  The query really
> isn't the problem, it's the sending of data when there is ALOT of data being
> sent.  Being that the actual data sent to the browser is minimal, both IE
> and Netscape wait until there is something worth printing before it renders
> the output.
>
> Basically, I need a way to force IE and Netscape to render the output so
> that the user doesn't get a timeout notification.
>
> --JMR
>
> [EMAIL PROTECTED]   wrote:
>
>
> Perhaps change it to an offline report?  I've done that in the past, it
>
> get's scheduled or backgrounded and the results are either emailed to the
>
> person, or generated report stored in the database for quick load later on
>
> (user gets email that report is ready for viewing)..
>
>
>
>
>
>
>
>
>
> On Thu, 21 Aug 2003, J. Michael Roberts wrote:
>
>
>
>
>
> Okay, I'm going mildly crazy now.
>
>
>
> I've got a huge query that runs and does all sorts of things...but the
>
> problem is that it's taking longer than the proxy server will allow to
>
> generate the HTML, thus the browser (IE) reports a timeout.
>
>
>
> I've successfully executed the entire script using Netscape, but Netscape
>
> appears to be a little more forgiving with it's buffer size than IE does.
>
>
>
> I've tried using a flush() call, but the output that is displayed to the
>
> user is fairly small in comparasion to all the stuff that's going on in the
>
> background.
>
>
>
> Is there a way to get IE to display the data it has received on the fly?  If
>
> not, is there a way to force IE (and netscape) to use a smaller buffer size?
>
> I've thought about filling up the output buffer with some hidden garbage,
>
> but that would just be silly.
>
>
>
> Any thoughts would be greatly appreciated.
>
>
>
> --JMR
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

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



Re: [PHP-DB] Browser timing out.

2003-08-21 Thread J. Michael Roberts
I've been going with the invisible data mathod right now and it doesn't seem
too bad.  What happens on the page is not much to look at and it only
returns maybe 1K while the script is running. However, what's happening in
the background is a huge-ass transfer of data.

To the user, all that's happening is "Running . . ." until the process is
(almost) done, at which point it tells them approximately when their request
will be completed.  To clarify, this is a print-request system I'm
developing so people stop bugging me about stupid printing stuff.  They pick
everything they need, how many copies, and the system does the rest for
them, insuring that the prints will look the same each and every time and
waste will be reduced to near-zero.  The big-ass query/process is the
transfer of data files to the printer. The actual database work is small and
fast.

What I've gone with (and works fairly well) is a print of 4096 spaces after
a file is transferred followed by a period. The user gets to watch a dot get
printed to the screen about once a second while their stuff is queued up.  I
was hoping to avoid having to send a bunch of whitespace, but it seems to be
the only way I can prevent a timeout.

--JMR

Micah Stevens wrote:


Once the current page has loaded, the browser should display whatever it's 

recieved, no matter how small. 



I'm a little confused as to what you're trying to do, are you displaying a 

litlle 'Please Wait for the big ass query' message for the user while the
SQL 

plugs away? IF that's the case, you could do a HTML meta refresh to display
a 

page that shows the message and then switches over to the second page that 

actually does the query. This works pretty well. 



I've had mixed results with the flush() command. It seems to work sometimes 

with just 1 byte of data, and othertimes it will wait for get a big chunck. 

('it' being the browser)



as far as doing it all on the same page goes, your best bet to deal with the


buffer is to output invisible data. IT seems silly, but as you can't
remotely 

control the buffer size, it'd probably do the trick. 



personally, I use the two page method though.









On Thursday 21 August 2003 1:18 pm, J. Michael Roberts wrote:

  

Okay, I'm going mildly crazy now.



I've got a huge query that runs and does all sorts of things...but the

problem is that it's taking longer than the proxy server will allow to

generate the HTML, thus the browser (IE) reports a timeout.



I've successfully executed the entire script using Netscape, but Netscape

appears to be a little more forgiving with it's buffer size than IE does.



I've tried using a flush() call, but the output that is displayed to the

user is fairly small in comparasion to all the stuff that's going on in the

background.



Is there a way to get IE to display the data it has received on the fly? 

If not, is there a way to force IE (and netscape) to use a smaller buffer

size? I've thought about filling up the output buffer with some hidden

garbage, but that would just be silly.



Any thoughts would be greatly appreciated.



--JMR







  




[PHP-DB] Question

2003-08-21 Thread Dankshit
Ís there a way to get a file version, just like we get the size and
date
 
 
Thanks in advance..
 
Rodrigo Corrêa


[PHP-DB] Re: Transferring MySQL data.

2003-08-21 Thread Roberto Dragva Filho
You can use phpmyadmin.
see http://www.phpmyadmin.net/
roberto

"Hugh Dickinson" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
This is probably a stupid question, but I'm pretty new at this!

Having built test MySQL databases for my website on my home machine, is it
possible to transfer the data straight to a web hosting company's server or
do I need to rebuild the databases again from scratch?

Thanks for any input,

Hugh Dickinson


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003



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



[PHP-DB] Need For SPEED

2003-08-21 Thread Creigh Shank
Using an Apache/PHP/MySQL/Linux (Redhat 8.0) solution, PHPList, to create 
an e-mailing list for our 5.6 million book club members.  Unfortunately, 
the import speed for importing records (at record number 150,000 the rate 
is about 2,000 records per hour).  We're running on the following:

P4 (1.5 Ghz), 1.2 Gbytes RAM (650 Mbytes RAM Disk using ramfs), IDE drive 
(72,00 rpm)

So far we've moved the MySQL data files (var/lib/mysql), PHP /tmp and 
upload directories and PHPlist web site files to RAM Disk (still just 
testing - not yet dealing with data safety issues).  With all of this 
tuning we're still at only 2,000 records per hour for uploading.

We need to be at 100,000 records per hour (uploading and sending seem to 
run at about the same rate - we need to be able to send to all book club 
members in the same week).  Any suggestions?

Creigh

(We're planning to run the system on a server with dual Opterons, 8 Gbytes 
RAM and RAID-5 SCSI drives, but I don't think the additional system 
horsepower will solve our problem.)

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


Re: [PHP-DB] Need For SPEED

2003-08-21 Thread Phil Driscoll
I'm not familiar with PHPList but... 
You might be able to get a significant speed increase by creating indexes in 
MySQL on some more of the fields in the table. For example, if the list code 
checks for duplicate email addresses, and the email address field is not 
indexed, then creating an index on that field will speed things up lots - 
especially as the table becomes big.

-- 
Phil Driscoll


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



Re: [PHP-DB] Need For SPEED

2003-08-21 Thread Ignatius Reilly
What is your data load method? What is the type of your table(s)?

With LOAD DATA and text files, I load several million rows in about a
minute.

Also please don't cross-post. Better first find out what the most suitable
mailing list is.

Ignatius
_
- Original Message -
From: "Creigh Shank" <[EMAIL PROTECTED]>
To: "MySQL Users" <[EMAIL PROTECTED]>; "PHP-db List"
<[EMAIL PROTECTED]>; "PHPList Users" <[EMAIL PROTECTED]>;
"Michiel Dethmers" <[EMAIL PROTECTED]>
Sent: Thursday, August 21, 2003 6:58 PM
Subject: [PHP-DB] Need For SPEED


> Using an Apache/PHP/MySQL/Linux (Redhat 8.0) solution, PHPList, to create
> an e-mailing list for our 5.6 million book club members.  Unfortunately,
> the import speed for importing records (at record number 150,000 the rate
> is about 2,000 records per hour).  We're running on the following:
>
> P4 (1.5 Ghz), 1.2 Gbytes RAM (650 Mbytes RAM Disk using ramfs), IDE drive
> (72,00 rpm)
>
> So far we've moved the MySQL data files (var/lib/mysql), PHP /tmp and
> upload directories and PHPlist web site files to RAM Disk (still just
> testing - not yet dealing with data safety issues).  With all of this
> tuning we're still at only 2,000 records per hour for uploading.
>
> We need to be at 100,000 records per hour (uploading and sending seem to
> run at about the same rate - we need to be able to send to all book club
> members in the same week).  Any suggestions?
>
> Creigh
>
> (We're planning to run the system on a server with dual Opterons, 8 Gbytes
> RAM and RAID-5 SCSI drives, but I don't think the additional system
> horsepower will solve our problem.)
>
>
> --
> 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] Need For SPEED

2003-08-21 Thread John Stoffel
> "Creigh" == Creigh Shank <[EMAIL PROTECTED]> writes:

Creigh> Using an Apache/PHP/MySQL/Linux (Redhat 8.0) solution,
Creigh> PHPList, to create an e-mailing list for our 5.6 million book
Creigh> club members.  Unfortunately, the import speed for importing
Creigh> records (at record number 150,000 the rate is about 2,000
Creigh> records per hour).  We're running on the following:

Creigh> P4 (1.5 Ghz), 1.2 Gbytes RAM (650 Mbytes RAM Disk using
Creigh> ramfs), IDE drive (72,00 rpm)

Creigh> So far we've moved the MySQL data files (var/lib/mysql), PHP
Creigh> /tmp and upload directories and PHPlist web site files to RAM
Creigh> Disk (still just testing - not yet dealing with data safety
Creigh> issues).  With all of this tuning we're still at only 2,000
Creigh> records per hour for uploading.

Creigh> We need to be at 100,000 records per hour (uploading and
Creigh> sending seem to run at about the same rate - we need to be
Creigh> able to send to all book club members in the same week).  Any
Creigh> suggestions?

What is your data source for the records?  Are they in a bunch of flat
files?  If so, cut out the overhead of Apache/PHP and use Perl with
the DBI modules to insert the records directly into your database.

Also, make sure you have the proper indexes for your database that can
be a killer.  Also, for that size of DB, I'd make sure you're using
InnoDB tables.  

What are your mysql settings like as well?  You can tune them up quite
a bit since your import will be the big problem at first, but then it
will mostly be just reads on the tables when you send out emails.

John
   John Stoffel - Senior Unix Systems Administrator - Lucent Technologies
 [EMAIL PROTECTED] - http://www.lucent.com - 978-952-7830

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