php-windows Digest 13 Mar 2004 07:52:20 -0000 Issue 2162

Topics (messages 23117 through 23125):

Re: Email Servers
        23117 by: Manuel Lemos
        23118 by: jon roig

Re: MSSQL inserting into a table with a valid result set
        23119 by: Gerardo Rojas
        23120 by: Svensson, B.A.T. (HKG)
        23121 by: Gerardo Rojas
        23122 by: Frank M. Kromann
        23123 by: hubo
        23124 by: Robert Twitty
        23125 by: Svensson, B.A.T. (HKG)

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Hello,

On 03/12/2004 04:25 AM, Will wrote:
I was wondering what everyone uses for there email servers?  I have been
having problems with bounced emails with an error.  A rely error.  It
only happens with certain email address.

My system is Windows XP, running Apache 1.2, PHP, MySQL.

This is a common misconception. SMTP servers are not meant to send messages but rather to receive them. The fact that many SMTP servers are capable of queueing and relaying messages under certain circunstances does not mean that your mailing problems will be solved.


If your messages are bouncing, there must be a reason. Often it can be an inappropriate use of message headers that make recipient servers confuse them with spam. If you are going to install an SMTP server in a private machine that was never meant to act as mail server, there are great chances of having your messages rejected, for instance for the lack of reverse DNS record.

Anyway, the mail() function, especially under Windows is very problematic. You may want to try this class that comes with a wrapper function named smtp_mail(). It emulates the mail() function except that it lets you enable direct delivery mode so you do not need an intermediate SMTP server.

In this case, if the messages that are rejected you will get the rejection error imediately so you stop wondering why and eventually fix any problems in your message.

You can also enable the debug mode so you can actually see the SMTP dialog as output of your script and understand better what is the problem.

http://www.phpclasses.org/mimemessage

You also need this for the actual SMTP delivery:

http://www.phpclasses.org/smtpclass



--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
I really dig the pegusus mail server. Easy to setup. Free. Works
flawlessly.

http://www.pmail.com

        -- jon

-----Original Message-----
From: Will [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 12, 2004 6:41 AM
To: 'Php-Windows '
Subject: RE: [PHP-WIN] Email Servers


The email address that I am sending it to, which is me bounces back
saying that it is an open rely and it will not be delivered.  I know the
email is used because it is my own.

~WILL~


-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 12, 2004 3:06 AM
To: 'Apache Server '; 'PHP & MySQL '; 'PHP King '; 'Php-Windows '
Subject: RE: [PHP-WIN] Email Servers

What is your problem with bounced emails?

You can just drop them if they are not important,
or try to re-send them later like three times and
then give up, and mark the e-mail adress as invalid,
or whatever.


P.S. Bounced e-mail is something we all need to learn to
live with. It will happen weather one likes it or not. D.S.


-----Original Message-----
From: Will
To: Apache Server; PHP & MySQL; PHP King; Php-Windows
Sent: 12-3-2004 8:25
Subject: [PHP-WIN] Email Servers

Hello everyone,
I was wondering what everyone uses for there email servers?  I have been
having problems with bounced emails with an error.  A rely error.  It
only happens with certain email address.

My system is Windows XP, running Apache 1.2, PHP, MySQL.

Any suggestions would be great. :)

~WILL~
PS: I am looking for free ones!! :) LOL

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

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

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.611 / Virus Database: 391 - Release Date: 3/3/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.611 / Virus Database: 391 - Release Date: 3/3/2004
 

--- End Message ---
--- Begin Message ---
Can i do a select from a PHP: resource (positive MSSQL result identifier)


--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]


-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 3:25 PM
To: '[EMAIL PROTECTED] '
Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result
set


You can do a insert into with a SELECT instead of VALUE,
but the attribute in the select must agree with the table
definition. 


-----Original Message-----
From: Gerardo Rojas
To: [EMAIL PROTECTED]
Sent: 11-3-2004 21:54
Subject: [PHP-WIN] MSSQL inserting into a table with a valid result set

I have a valid result set from running a simple query.  Is there a way
of inserting this into an existing table or creating a new table with
the result set?  All ideas are welcome!

MSSQL Server 2000
PHP 4.3.4
Windows 2000 pro
IIS 5.0


--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]

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

--- End Message ---
--- Begin Message ---
I don't understand your question.

On Fri, 2004-03-12 at 16:42, Gerardo Rojas wrote:
> Can i do a select from a PHP: resource (positive MSSQL result identifier)
> 
> 
> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]
> 
> 
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 3:25 PM
> To: '[EMAIL PROTECTED] '
> Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result
> set
> 
> 
> You can do a insert into with a SELECT instead of VALUE,
> but the attribute in the select must agree with the table
> definition. 
> 
> 
> -----Original Message-----
> From: Gerardo Rojas
> To: [EMAIL PROTECTED]
> Sent: 11-3-2004 21:54
> Subject: [PHP-WIN] MSSQL inserting into a table with a valid result set
> 
> I have a valid result set from running a simple query.  Is there a way
> of inserting this into an existing table or creating a new table with
> the result set?  All ideas are welcome!
> 
> MSSQL Server 2000
> PHP 4.3.4
> Windows 2000 pro
> IIS 5.0
> 
> 
> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
According to your last email, i can accomplish my goal, by doing:

insert into tablename select xxxxx

where xxxx is another table i presume.

I don't have another table, all I have is a valid $result from running a query.

I see what you mean, the thing is that one query is from 1 remote db and the second 
query (insert command) is on another remote db.
 

--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]


-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 12:26 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result
set


I don't understand your question.

On Fri, 2004-03-12 at 16:42, Gerardo Rojas wrote:
> Can i do a select from a PHP: resource (positive MSSQL result identifier)
> 
> 
> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]
> 
> 
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 3:25 PM
> To: '[EMAIL PROTECTED] '
> Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result
> set
> 
> 
> You can do a insert into with a SELECT instead of VALUE,
> but the attribute in the select must agree with the table
> definition. 
> 
> 
> -----Original Message-----
> From: Gerardo Rojas
> To: [EMAIL PROTECTED]
> Sent: 11-3-2004 21:54
> Subject: [PHP-WIN] MSSQL inserting into a table with a valid result set
> 
> I have a valid result set from running a simple query.  Is there a way
> of inserting this into an existing table or creating a new table with
> the result set?  All ideas are welcome!
> 
> MSSQL Server 2000
> PHP 4.3.4
> Windows 2000 pro
> IIS 5.0
> 
> 
> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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

--- End Message ---
--- Begin Message ---
The short answer os 'No'

SQL statements are precessed by the SQL server and returned to the client
(PHP) as a result. SQL Server has no knowledge about PHP or any other
tools building on ODBC/dblib/OLEDB or any other protocol used to
communicate with the server.

- Frank

> I don't understand your question.
> 
> On Fri, 2004-03-12 at 16:42, Gerardo Rojas wrote:
> > Can i do a select from a PHP: resource (positive MSSQL result
identifier)
> > 
> > 
> > --
> > Gerardo S. Rojas
> > mailto: [EMAIL PROTECTED]
> > 
> > 
> > -----Original Message-----
> > From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 11, 2004 3:25 PM
> > To: '[EMAIL PROTECTED] '
> > Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid
result
> > set
> > 
> > 
> > You can do a insert into with a SELECT instead of VALUE,
> > but the attribute in the select must agree with the table
> > definition. 
> > 
> > 
> > -----Original Message-----
> > From: Gerardo Rojas
> > To: [EMAIL PROTECTED]
> > Sent: 11-3-2004 21:54
> > Subject: [PHP-WIN] MSSQL inserting into a table with a valid result
set
> > 
> > I have a valid result set from running a simple query.  Is there a
way
> > of inserting this into an existing table or creating a new table with
> > the result set?  All ideas are welcome!
> > 
> > MSSQL Server 2000
> > PHP 4.3.4
> > Windows 2000 pro
> > IIS 5.0
> > 
> > 
> > --
> > Gerardo S. Rojas
> > mailto: [EMAIL PROTECTED]
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
You might want to try the SQL

insert into sometable select * from someothertable where something =
somethingelse


"Gerardo Rojas" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
I have a valid result set from running a simple query.  Is there a way of
inserting this into an existing table or creating a new table with the
result set?  All ideas are welcome!

MSSQL Server 2000
PHP 4.3.4
Windows 2000 pro
IIS 5.0


--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hi Gerardo

If I understand you correctly, you can use the odbtp extension to
do something like the following:

$con1 = odbtp_connect( 'server1', 'user1', 'pass1', 'database1' ) or die;
$con2 = odbtp_connect( 'server2', 'user2', 'pass2', 'database2' ) or die;

$sql = "SELECT FieldA, FieldB, FieldC FROM Table1";
$qry1 = odbtp_query( $sql, $con1 ) or die;
odbtp_attach_field( $qry1, "FieldA", $FieldA );
odbtp_attach_field( $qry1, "FieldB", $FieldB );
odbtp_attach_field( $qry1, "FieldC", $FieldC );

$sql = "INSERT INTO Table2(FieldA, FieldB, FieldC) VALUES( ?, ?, ? )";
$qry2 = odbtp_prepare( $sql, $con2 ) or die;
odbtp_input( $qry2, 1 );
odbtp_attach_param( $qry2, 1, $FieldA );
odbtp_input( $qry2, 2 );
odbtp_attach_param( $qry2, 2, $FieldB );
odbtp_input( $qry2, 3 );
odbtp_attach_param( $qry2, 3, $FieldC );

while( odbtp_fetch( $qry1 ) ) odbtp_execute( $qry2 ) or die;

odbtp_close( $con1 );
odbtp_close( $con2 );

-- bob

On Fri, 12 Mar 2004, Gerardo Rojas wrote:

> According to your last email, i can accomplish my goal, by doing:
>
> insert into tablename select xxxxx
>
> where xxxx is another table i presume.
>
> I don't have another table, all I have is a valid $result from running a query.
>
> I see what you mean, the thing is that one query is from 1 remote db and the second 
> query (insert command) is on another remote db.
>
>
> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]
>
>
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 12, 2004 12:26 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result
> set
>
>
> I don't understand your question.
>
> On Fri, 2004-03-12 at 16:42, Gerardo Rojas wrote:
> > Can i do a select from a PHP: resource (positive MSSQL result identifier)
> >
> >
> > --
> > Gerardo S. Rojas
> > mailto: [EMAIL PROTECTED]
> >
> >
> > -----Original Message-----
> > From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 11, 2004 3:25 PM
> > To: '[EMAIL PROTECTED] '
> > Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result
> > set
> >
> >
> > You can do a insert into with a SELECT instead of VALUE,
> > but the attribute in the select must agree with the table
> > definition.
> >
> >
> > -----Original Message-----
> > From: Gerardo Rojas
> > To: [EMAIL PROTECTED]
> > Sent: 11-3-2004 21:54
> > Subject: [PHP-WIN] MSSQL inserting into a table with a valid result set
> >
> > I have a valid result set from running a simple query.  Is there a way
> > of inserting this into an existing table or creating a new table with
> > the result set?  All ideas are welcome!
> >
> > MSSQL Server 2000
> > PHP 4.3.4
> > Windows 2000 pro
> > IIS 5.0
> >
> >
> > --
> > Gerardo S. Rojas
> > mailto: [EMAIL PROTECTED]
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
You can a) spool your result set to a tab delimited file and
bulk load (should be the fastest way), or b) use the same file
and use bulk insert, or c) insert the result set "manually"
with php into some table that you either create on the fly
or already have availabe in the target database, etc, etc.



-----Original Message-----
From: Gerardo Rojas
To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED]
Sent: 12-3-2004 19:30
Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result set

According to your last email, i can accomplish my goal, by doing:

insert into tablename select xxxxx

where xxxx is another table i presume.

I don't have another table, all I have is a valid $result from running a
query.

I see what you mean, the thing is that one query is from 1 remote db and
the second query (insert command) is on another remote db.
 

--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]


-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 12:26 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid result
set


I don't understand your question.

On Fri, 2004-03-12 at 16:42, Gerardo Rojas wrote:
> Can i do a select from a PHP: resource (positive MSSQL result
identifier)
> 
> 
> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]
> 
> 
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 3:25 PM
> To: '[EMAIL PROTECTED] '
> Subject: RE: [PHP-WIN] MSSQL inserting into a table with a valid
result
> set
> 
> 
> You can do a insert into with a SELECT instead of VALUE,
> but the attribute in the select must agree with the table
> definition. 
> 
> 
> -----Original Message-----
> From: Gerardo Rojas
> To: [EMAIL PROTECTED]
> Sent: 11-3-2004 21:54
> Subject: [PHP-WIN] MSSQL inserting into a table with a valid result
set
> 
> I have a valid result set from running a simple query.  Is there a way
> of inserting this into an existing table or creating a new table with
> the result set?  All ideas are welcome!
> 
> MSSQL Server 2000
> PHP 4.3.4
> Windows 2000 pro
> IIS 5.0
> 
> 
> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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

--- End Message ---

Reply via email to