Re: [PHP-DB] Database Paging

2001-03-06 Thread Manuel Lemos

Hello,

Vipin Chandran wrote:
> 
> Hello,
> I am presently developing a search engine..I would like to have a script for
> paging through my database results...like "displaying 1 to 20 of 300
> matches" and so on..

You may want to try to use Metabase which is a PHP abstraction package
that provides that facility for all supported databases:

http://phpclasses.UpperDesign.com/browse.html/package/20

You may also want to try this Query display result class that takes
advantage of Metabase to display query results in HTML tables with links
to go between result pages:

http://phpclasses.UpperDesign.com/browse.html/package/130

Manuel Lemos

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




Re: [PHP-DB] LIMIT in MS SQL

2001-03-12 Thread Manuel Lemos

Hello.

Fredrik Wahlberg wrote:
> 
> Is there any equivalent to MySQL's ?LIMIT x,y? in Microsoft SQL-Server?

You need to use server side cursors. You may want to look at how
Metabase, the PHP database abstraction package does it when using
MS-SQL. For Metabase users, it is as simple as calling the function
MetabaseSetSelectedRowRange($database,$first,$limit) before each query.

You may find Metabase here:

http://phpclasses.UpperDesign.com/browse.html/package/20

You may also want to try this PHP Class that displays query results in
HTML tables with links to go back and forth between pages.

http://phpclasses.UpperDesign.com/browse.html/package/130

Manuel Lemos

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




Re: [PHP-DB] limit in informix

2001-03-12 Thread Manuel Lemos

Hello,

Luigi Barone wrote:
> 
> I have the same problen of Fredrik
> Is there any equivalent to MySQL's ?LIMIT x,y? in Informix Dynamic Server
> 2000?

As you may have noticed, I have just replied a similar message but about
MS-SQL. The same Metabase base solution can work for Informix because
Metabase also supports Informix.

Manuel Lemos

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




Re: [PHP-DB] DB Abstraction

2001-03-18 Thread Manuel Lemos

Hello Jordan,

On 11-Mar-01 09:47:16, you wrote:

>I thought it was about time I started using a db abstraction class. Problem 
>is, there are so many out there that I don't which one to start using?

If you are looking for a database abstraction package, I suppose you are
looking that assures a smooth transition of your applications to work with
different databases than those you use today.

Maybe you want to try Metabase.  It is a PHP database abstraction package
that not only provides a means to write portable applications that access
databases, but also is able to install database schema from a database
independent schema description format that you can edit by hand in a custom
XML format.

Metabase is freely available and has been downloaded by over 4.400 users
from here:

http://phpclasses.UpperDesign.com/browse.html/package/20

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


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




Re: [PHP-DB] managing large result sets

2001-03-29 Thread Manuel Lemos

Hello,

houston wrote:
> 
> I have to deal with displaying result sets that could potentially be quite
> large.  It would be bad form to drop 10,000 rows into a browser table so I
> need a strategy for dealing with this possibility.
> 
> It's obviously not a big deal to limit the output but what is the typical
> strategy for handling   behavior?  It seems terribly
> inefficient to requery for a subset each time.  I suppose that I could dump
> the entire result set to a text file keyed to the session but that raises
> the problem of garbage collection with potentially large files.  Anyone have
> experience with this problem?

It is an everyday problem with Web programming. Regardless of the
database you are using, you may want to try Metabase which is a PHP
database abstraction package that lets you specify a range of rows to
retrieve from the server. All you need to do is call
MetabaseSetSelectedRowRange($database,$first,$limit) before you execute
a query. It will return result rows starting row $first upto the a
$limit number of rows. It works like MySQL LIMIT clause, except that it
works all supported databases (Oracle, MS SQL, Informix, Interbase,
PostgreSQL, etc...).

http://phpclasses.UpperDesign.com/browse.html/package/20

There is also a PHP classes that takes advantage of this capability of
Metabase to display query results in HTML tables that may appear split
between different pages that you may navigate with links that the classe
automatically generates for you near the HTML tables.

http://phpclasses.UpperDesign.com/browse.html/package/130


Manuel Lemos

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




Re: [PHP-DB] ALTER TABLE - code not working.

2001-03-29 Thread Manuel Lemos

Hello,

"Martin E. Koss" wrote:
> 
> I have been trying to get a new column added to a table (vips) via a PHP
> script, but having exhausted all the things I can find, I'm still
> struggling. I've referred t TFM for all those who just can't wait to tell me
> to do so, and believe my SQL statement is correct:
> 
> $NewCol = $Prod_Code;
> $defaultvalue = "0.00";
> // make usual connection
> $conID = mysql_pconnect ("localhost","admin","mek1233");
> mysql_select_db("FocusDynamics", $conID);
> // set the query
> $AddColQuery = "ALTER TABLE vips ADD COLUMN $NewCol";
> $result = mysql_query ($AddColQuery,$conID);
> // now set the default value for all rows in vips table
> $SetDefault = "UPDATE TABLE vips SET $NewCol=$defaultvalue";
> $result = mysql_query ($SetDefault,$conID);
> 
> It is NOT adding the column, and obviously not setting the default.

I presume that the $Prod_Code is just the name of the field. You also
need to declare the type of the field. BTW, if you declare the default
value too in the ALTER TABLE statement the existing rows will be filled
with that value in that column.

You may want to look at Metabase which is a PHP database abstraction
package that is able to install and maintain database schema giving just
a schema description file defined in a specific XML format. Metabase is
able to parse the schema definitions and install any tables, fields,
indexes and sequences described in the schema definition.

When you want to change anything in your schema (adding, removing,
altering tables, fields, indexes and sequences) Metabase manager will
figure the changes you made in the schema definition and apply them to
the installed database without disturbing any data already inserted
after the first time the schema was installed or it was changed for the
last time. No sweat, no risk mistake. Look at Metabase here:

http://phpclasses.UpperDesign.com/browse.html/package/20

Manuel Lemos

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




Re: [PHP-DB] ALTER TABLE - code not working.

2001-03-29 Thread Manuel Lemos

Hello,

"Martin E. Koss" wrote:
> 
> While I appreciate your comments about metabase I simply don't have time to
> start the project again, it has taken a long time to get this far. Perhaps
> I'll look at metabase for future developments.
> 
> In the meantime, anyone seeing this message for the first time, I'm still
> struggling with my code below:

Your mistake is very basic. If you read my message again, you can see
that I am telling you that you are forgetting to declare the type of the
column that you want to add.

My suggestion to use Metabase is that it helps you to maintain database
schemas without having to struggle with the way that the database wants
you to declare the changes you want to be done. If you are having
difficulty to understand how it needs to be done now, chances are that
you will still have difficulty to figure how to make these and other
types of database schema changes in the future. If switching to Metabase
would be a good idea to avoid your difficulties, it is up to you to
figure.

Manuel Lemos

> 
> Martin.
> 
> -Original Message-
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> Sent: 29 March 2001 14:05
> To: [EMAIL PROTECTED]; Martin E. Koss
> Subject: Re: [PHP-DB] ALTER TABLE - code not working.
> 
> Hello,
> 
> "Martin E. Koss" wrote:
> >
> > I have been trying to get a new column added to a table (vips) via a PHP
> > script, but having exhausted all the things I can find, I'm still
> > struggling. I've referred t TFM for all those who just can't wait to tell
> me
> > to do so, and believe my SQL statement is correct:
> >
> $NewCol = $Prod_Code;
> $defaultvalue = "0.00";
> // make usual connection
> $conID = mysql_pconnect ("localhost","myusername","mypassword");
> mysql_select_db("FocusDynamics", $conID);
> // set the query
> $AddColQuery = "ALTER TABLE vips ADD COLUMN $NewCol";
> $result = mysql_query ($AddColQuery,$conID);
> // now set the default value for all rows in vips table
> $SetDefault = "UPDATE TABLE vips SET $NewCol=$defaultvalue";
> $result = mysql_query ($SetDefault,$conID);
> 
> It is NOT adding the column, and obviously not setting the default.
> 
> I presume that the $Prod_Code is just the name of the field.
> YES! You assume right.
> Martin.
> 
> You also
> need to declare the type of the field. BTW, if you declare the default
> value too in the ALTER TABLE statement the existing rows will be filled
> with that value in that column.
> 
> You may want to look at Metabase which is a PHP database abstraction
> package that is able to install and maintain database schema giving just
> a schema description file defined in a specific XML format. Metabase is
> able to parse the schema definitions and install any tables, fields,
> indexes and sequences described in the schema definition.
> 
> When you want to change anything in your schema (adding, removing,
> altering tables, fields, indexes and sequences) Metabase manager will
> figure the changes you made in the schema definition and apply them to
> the installed database without disturbing any data already inserted
> after the first time the schema was installed or it was changed for the
> last time. No sweat, no risk mistake. Look at Metabase here:
> 
> http://phpclasses.UpperDesign.com/browse.html/package/20
> 
> Manuel Lemos
> 
> --
> 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]
> 
> --
> 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]

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




Re: [PHP-DB] metabase support

2001-04-01 Thread Manuel Lemos

Hello Dean,

On 01-Apr-01 06:38:32, you wrote:

>I just want to make sure that I'm understanding what metabase supports.

>It does not support:
>- references
>- primary keys

>Does anyone find that this prevents you from using metabase? Or do you find
>that you have to hack your way around these deficiencies?

You can live perfectly well without both.

In practice primary keys are not much more than declaring a unique index on
the key fields.

References or foreign keys have a role of assuring database integrity.
This means that if you update your database tables and not assure that
specified references exist consistently, the DBMS will fail on those
updates.

It's not like it will avoid your application bugs, but at least if your
application has a bug that would break the database integrity, well placed
references/foreign keys will prevent that to happen.  Your application will
just stop working until you fix the bugs.




>I use MySQL most of the time, so I've learned to design without explicit
>references, but I'd like to have the opportunity to at least specify
>references in the schema definition (which MySQL allows but doesn't do
>anything with). It seems that with a DBMS-independent abstraction layer like
>metabase something like this should be supported.

Support for primary/foreign keys is in my to do list.  It just did not
become a priority because there are other things more important to add like
BLOBs.

Metabase is about to go Open Source.  I am just waiting to finish a great
design tool before I announce when Metabase will be open for other
developers to contribute with work that I can't do right away.

Anyway, that should not stop you from using Metabase as it is.  Metabase is
the only PHP database abstraction package that does schema management.  You
can live without schema management, but it provides great schema
maintenance aid.

When support for primary/foreign keys is added explicitly you will be able
to upgrade your schemas without worry.  So, you can use Metabase with
schema management as it is now.


Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


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




Re: [PHP-DB] PEAR DB documentation?

2001-04-01 Thread Manuel Lemos

Hello Dean,

On 01-Apr-01 07:33:02, you wrote:

>I've used DB in the past, but since I'm writing a public-use app, I thought
>I'd use metabase, since it's DBMS-independent. DB seems to be the more
>traditional way of using database abstraction layers (as in Perl DBI and
>such); the interface is DBMS independent -- whether the SQL you write is
>DBMS-independent is another story. Metabase provides for means for making
>your SQL DBMS-independent, so it's really quite another step beyond
>traditional database abstraction.

That's right.  When it comes to database application portability, maybe the
only thing that comes close to Metabase is Java JDBC.  Even when compared
with that, Metabase offers features without parallel that are very
important for Web applications like:

- Auto-incremented sequences:  objects that store integers and return
incremental unique values on demand.  It's very important for databases
with fields with unique indexes, primary keys or other unique integer
values.  In databases that do not support real sequence objects (like
MySQL), auto-incremented fields are used, but the API is always the same.

- Select row ranges:  lets you specify a range of rows (start, limit) that
you want to retrieve from a select query.  It's very important to display
query result listings split in pages with a limit of displayed rows.  It's
like MySQL LIMIT clause, but it works with all databases supported by
Metabase.


>However, you seem to lose /a lot/ of features of whatever DBMS you use if
>you use metabase. It supports few data types (domains), and it doesn't
>support specifying primary keys or references. I'm trying to see if I can
>get by without them.

This is not accurate.  Metabase supports the following data types:  text,
boolean, integer, decimal (fixed point), float, date, time, time stamp
(date and time).  Some databases do not support some of these data types,
but  Metabase  emulates  them for you.  So, it's not like you lose a lot of
features, but rather you gain some that you wouldn't if you do not use
Metabase.


>If you're using an abstraction layer b/c your app may need to be reused with
>a different DBMS than you're currently using, metabase may be a good choice;
>however, if you're guaranteed you'll always use the same DBMS, I'd use
>PEAR's DB. Much simpler.

PEAR DB is simpler because it lacks many features that Metabase provides.
The features that Metabase has in addition are highly desirable in
particular for Web development.  If you don't miss those features now,
chances are that you may miss them sooner or later.

PEAR DB developement was started much later than Metabase's, so PEAR DB is
less mature.  When PEAR DB development reaches the maturity of PEAR DB, it
certainly won't look that much simpler.


Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


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




[PHP-DB] Re: nested sets?

2003-11-21 Thread Manuel Lemos
Hello,

On 11/20/2003 12:28 PM, Ma wrote:
i try to make a clickable menu. it should be outputed as XML. i found a
solution to make it possible to decend only the selected menues. but is
there a easier solution?
my goal is to first show only the first (level=0) level. if the user clicks
on the menu it should select the second (level=1) level, but only from the
menu he clicked. (so HAVING level<=1 doesn't help :( )
does anybody know a solution or a good reference for nested sets?
You may want to try the famous Joe Celko's approach that he described in 
this book:

Book review: SQL for Smarties
http://www.phpclasses.org/products.html/id/1558605762.html
If you do not want to reinvent the wheel, you may want to try this 
implementation:

Class: Joe Celko Nested Sets
http://www.phpclasses.org/celkonestedset
--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Transfering large mysql database

2003-12-08 Thread Manuel Lemos
Hello,

On 12/08/2003 10:08 PM, Harlan Lax wrote:
Does anyone have a recomendation on an app that will help me transfer a
large table from one host provider to another.  I have tried phpmyadmin but
if I export to SQL the import doesn't seem to work.  If I export to csv I
lose the column formating.
On one host I have access to the root and on the other I am very limted.
Here you may find several solutions to backup and restore whole MySQL 
databases or just single tables:

http://www.phpclasses.org/backup

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: php mail() question

2003-12-15 Thread Manuel Lemos
Hello,

On 12/14/2003 11:51 PM, Jerry wrote:
Php mail() question.

I use php mail() frequently, dragging data from a
mysql database.  I am not sure if this is possible but
thought I'd throw it on this board.
in php mail() function you can set a return_address
etc.  Is it possible to change this and run a query? 
I mean if the email bounces can it somehow talk back
to php mail() and do a query rather than send it to
the return_address?
If you make the bounce address point to a POP3 mailbox, you have a 
platform independent solution to handle bounces. Then you just need to 
use some POP3 component like this to fetch and process the bounced 
messages once in a while, for instance starting a PHP script from a cron 
task. I do this all the time to handle bounces from newsletters that I 
send from my site.

http://www.phpclasses.org/pop3class

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: php mail() question

2003-12-15 Thread Manuel Lemos
Hello,

On 12/15/2003 10:23 PM, Jerry wrote:
Thanks for that.  That's hitting the nail right on the
head.
But I need a bit of PHP code to talk to mysql and only
read the "from" part of the email and use a query to
check the database if the entry is there.  If it is
than flag it, if not skip it and delete the email.
So would I need to edit the code to make the from
section a input form or can I somehow get a query to
get the from data from plain text?
All I want is the from address, the rest I don't
really need.
So

UPDATE users SET flag='y' WHERE email='$from_address';

Might even output something to make sure it was
sucessful or not.
What I need to know is how I get the from address?
That's tricky. What I do is to have a catch-all mailbox for my site 
domain. So, every message sent to a mailbox that does not really exist 
will be dropped in that catch-all mailbox.

When I send messages to each user, I make the return path address be set 
to something like [EMAIL PROTECTED] .

For instance, messages sent to [EMAIL PROTECTED] by the PHP Classes 
site, will have the return path set to 
[EMAIL PROTECTED] .

Since these address really do not exist, they will be dropped in the 
catch-all mailbox for that domain. So, all I need to do is to run a 
script that polls the POP3 mailbox of my catch-all account and parse the 
To: address of the bounced messages to figure the subscriber address 
that is bouncing. Not all bounce message will have the To: address set 
correctly. The remaining message should be ignored.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: php mail() question

2003-12-16 Thread Manuel Lemos
Hello,

On 12/16/2003 10:04 PM, Jerry wrote:
Actually I just relised what you meant. :P  And that
would work great by having it like that.. Something
like this would work fine.
If the email bounces return it to
[EMAIL PROTECTED]
So I would set the sender as whatever I want and the
return_path as a way to identify the user?  Is that
what you meant?
That would mean I'd need a way to fetch the to:
address from the pop3.php, how is this possible?
At the pressent time I am doing everything manually. 
So I am going into the email and grabbing the address,
doing a search on the database and when found flagging
the account with abad email address.  Quite time
consuming when alot of bounces occours.

So an automatic way to fasten up the process would be
great.  I don't mind if I have to activate the script
manually.  Just be great to have things moving along a
bit faster than the pressent speed.
Actually I start a PHP script from the cron task that runs every 5 
minutes using PHP CGI executable version. I just process upto 100 
bounced messages per run avoid hogging the database server and blocking 
the POP3 mailbox for a long time, as this is not a prioritary task.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: php mail() question

2003-12-21 Thread Manuel Lemos
Hello,

On 12/18/2003 10:44 AM, Jerry wrote:
How do I list the headers that are ouputed in the page
into the text area also?
You just need to call the RetrieveMessage function that returns the 
headers of each message and then look for the To: header.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Reading emails with PHP

2003-12-21 Thread Manuel Lemos
Hello,

On 12/19/2003 09:54 AM, David T-G wrote:
OK, so on to the script.  Just as PHP has classes, perl has modules which
implement object code.  Just as PHP has PEAR (I think; I'm still getting
to know it), perl has CPAN, the Comprehensive Perl Archive Network.  One
advantage of perl's maturity is an almost ridiculously vast wealth of
contributed modules; if you want to do it, someone has almost certainly
already written a module for it.  [This is already on the way for PHP
and PEAR; in just a few years I, too, predict that PHP will be hugely
popular.]  The one used here is Mail::DeliveryStatus::BounceParser.
This solution has two significant limitations:

1) Many bounces will not be returned as delivery status messages

2) Many users may be register with e-mail addresses which are just 
forwarding addresses, so the address returned by the report specifies 
the final address and not the actual address of subscription.

A more useful solution is one based on setting the return path address 
of the message being sent in such a way that you can retrieve the 
original recipient address from the bounced message recipient address.

This has just been discussed here:

http://marc.theaimsgroup.com/?t=1071585&r=1&w=2

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: php mail() question

2003-12-22 Thread Manuel Lemos
Hello,

On 12/22/2003 12:13 PM, Jerry wrote:
You just need to call the RetrieveMessage function
that returns the 
headers of each message and then look for the To:
header.

Ummm, why can't you give me a working code that grabs
the headers and put it into a textarea?  
Hey, I can tell you how to fish, but it needs to be the one that will 
fish for yourself. Meaning, I have given you enough information for you 
to take the class and do what you need it to do.

If you are having difficulties, maybe you just ask for help probably 
paying for the work. Sorry, I can't help you now, but here you may find 
solve your problem.

http://www.php-freelancers.com/


echo "";
echo "'";
echo "\n";
echo "";
Results in the form area being blank.

Replacing 'HtmlSpecialChars' with 'RetrieveMessage'
comes back with an error saying it's not deinfed on
line blah
This does not make sense. You need to understand what you are doing.

Text areas do not take any value attributes. The text that will show 
must be entered between 

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Database Abstraction Layer?

2004-01-21 Thread Manuel Lemos
Hello,

On 01/21/2004 06:31 AM, Muhammed Mamedov wrote:
What do you think is the best method to abstract php code from a specific database?.
Make PHP code 100% database independent?..
If you really want true portability, you may want to try Metabase or 
PEAR::MDB which is a conversion of Metabase to follow PEAR coding style, 
although not all Metabase drivers have been ported to MDB.

Metabase was written with the specific goal to be truly database 
independent, so you do not have to change anything in your application 
to make it work with different applications.

This means that not only the database access is portable but also the 
schema installation and maintenance. Metabase lets you define your 
database schema in a simple XML format and then it takes care of 
creating the tables, fields, indexes and sequences in any of the 
supported databases.

If you want to change your schema, just edit the XML definition and 
Metabase is capable of figuring what changed and alter the installed 
schema according to the database you are using, without affecting any 
data that was added since the database was installed for the first time 
or after it was updated for the last time.

If you have an application working with an existing database, Metabase 
provides experimental support for migrating the installed schema to the 
database independent XML definition format.

http://www.phpclasses.org/metabase

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: A site mapped in a database / xml

2004-01-21 Thread Manuel Lemos
Hello,

On 01/21/2004 08:52 PM, Shaun wrote:
I have an question on how to create a completely database / xml driven site
i.e. the page names, links, the site map etc are held in the database. I
think I have solved most problems but what I would really like to do is
limit the number of pages I need. Can I manipulate the server such that if I
have links to a pages; red_hats.php and yellow_hats.php can both these pages and others
link to a different page that dynamically constructs whilst the links aren't
altered. Maybe is there some way that a default php page is called that
reads the link of the page called etc.
I think this class does exactly what you ask:

Class: XMap
http://www.phpclasses.org/xmap
--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: SMTP authentication

2004-02-09 Thread Manuel Lemos
Hello,

On 02/09/2004 11:40 AM, Marco A. Ortiz wrote:
I want to ask you, how I must setup my PHP.INI file, to send e-mail from my
Web Site if my SMTP server requires authentication. Otherwise, I want to
know if exits some kind of “public” SMTP sever that I could use.
No, the mail() function does not SMTP authentication. You may want to 
use this class that comes with a wrapper function named smtp_mail() that 
works like mail() except that it does let you specify the authentication 
credentials:

http://www.phpclasses.org/mimemessage

http://www.phpclasses.org/smtpclass

--

Um abraço,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: mail() and sendmail configuration

2004-02-23 Thread Manuel Lemos
Hello,

On 02/23/2004 01:18 PM, [EMAIL PROTECTED] wrote:
This post is somewhat OT -- please forgive me. I've spent over 3 days 
trying to get sendmail configured and I've lost some patience and 
reasoning ability in the process.

I have a Linux (RH9), Apache 2.0.48, PHP 4.3.4, MySQL GUI that creates a 
PDF document on the server for web access. We would also like to have the 
document emailed to several folks within the company. So I essentially 
have to get the PDF attached to an email and routed to our SMTP server. I 
have webmin installed and have tried to use it to configure sendmail. When 
I execute  /etc/rc.d/init.d/sendmail status  ---  Linux says that sendmail 
is running. 
Several things:

- Are you sure that the sendmail path is configured in php.ini to the 
correct path of sendmail program? Usually it is /usr/sbin/sendmail .

- Sending messages does not require relaying on a SMTP server. A SMTP 
server is only needed for receiving or relaying messages. The sendmail 
program does not queue messages via SMTP, it just delivers them or drop 
in the local queue for later deliver. Only on Windows, SMTP relaying is 
done because usually there is no sendmail or compatible local mailer 
installed, although there is sendmail for Windows.

- I recommend trying this class for composing and sending messages. It 
supports adding attachments to the messages and usually it returns 
verbose error messages when it fails for some reason, saving you 
countless hours or blind error and trial attempts.

http://www.phpclasses.org/mimemessage

--

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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: How to simplify DB creation?

2004-03-19 Thread Manuel Lemos
Hello,

On 03/18/2004 01:35 PM, Michal Masa wrote:
We plan to write a simple DB with app. 10 tables. Are there any tools that
simplify and automatize the creation of PHP scripts for the database?
Like automatic generation of PHP scripts that produce HTML input forms,
generation of value lists, validation, sorting and searching?
Well documented PHP library could be also useful.
You may want to take a look at this generator tool:

http://www.meta-language.net/metastorage.html

http://www.meta-language.net/screenshots.html

--

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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] ANN: Released extensive Metastorage documentation

2004-03-22 Thread Manuel Lemos
Hello,

New and improved Metastorage documentation materials were released with 
the intention of helping developers to get started with this software 
development productivity tool and quickly deploy their PHP applications.

Besides the Metastorage reference manual that already existed and was 
improved for this release, there is now a tutorial and an how-to 
document to address different levels of interest from the developers on 
Metastorage documentation.

http://www.meta-language.net/news-2004-03-20-metastorage.html

http://www.meta-language.net/screenshots.html

What is Metastorage?

Metastorage is an application that is meant to automatically generate 
code from an high level data model definition.

Metastorage is a tool meant to provide an efficient method of 
development of medium or large size applications that store and retrieve 
data from SQL based databases or other types of persistence storage 
containers, like XML files, flat file databases or in LDAP servers.

What does Metastorage generate?

Metastorage generates data object access classes. Currently it generates 
code in PHP. The data objects are stored in SQL based relational 
databases. In the future, other languages and storage containers will be 
supported.

http://www.meta-language.net/metastorage-faq.html



--

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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Mail() - Preposterous Accusation

2004-04-09 Thread Manuel Lemos
Hello,

On 04/08/2004 08:25 PM, Ryan Jameson wrote:
... Is there a way to get the bounces to go to the reply to address?
I've never really cared to, but now that he mentions it ... It would be
nice.
If you use this class, you can just specify the bounce address in 
Return-Path header and the class will take care of composing and sending 
the message in an appropriate way to make the bounces go to the 
specified address when possible. Keep in mind that just specifying the 
Return-Path header when you use the mail() function directly will not 
work. This class does some magic to make it happen depending on your system.

http://www.phpclasses.org/mimemessage

--

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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Dynamic Form?

2004-04-13 Thread Manuel Lemos
Hello,

On 04/13/2004 05:25 PM, Aaron Wolski wrote:
I've been given the task of developing a dynamic form for a client.

When I say dynamic, I mean dynamic in that the client can use an
administrative interface (back-end) to create the various form fields
(and types) that get displayed on the front-end.
Before I start brainstorming the DB and programming requirements, I'd
take a stab to see if anyone knows of open source software that might do
what I am looking for? Wheel reinvention is not high on my task list.
You may want to try this popular forms generation and validation class. 
You can use it with plain HTML templates or integrate with Smarty 
templates as it comes with a specific plug-in:

http://www.phpclasses.org/formsgeneration

--

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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: mail() function and AOL users

2004-05-18 Thread Manuel Lemos
Hello,
On 12/12/2003 04:34 AM, Matt Perry wrote:
I use the following php mail function in an online applicaiton program:
mail($email, "application submitted", $message, "From: 
[EMAIL PROTECTED]");

This function does not always work when I modify $message.  I have 
checked for null values for $message already but this does not seem to 
be the problem.
I am trying to develop some sort of pattern of when this function works 
and when it does not.
The only essential difference between the values I pass in for message 
is the one that does not always work includes a link.  Apparently anyone 
useing AOL email is particularly vulnerable to this problem.

Is it likely that AOL and other mail servers sometimes block any email 
from a web site if it has a link in the main body?  Or should I not be 
useing mail() in this manner to begin with?
Maybe you are not generating the message headers and body properly. 
Without seeing the code that you use to define $message, it is hard to tell.

I just suggest that you try this class to properly compose and send your 
messages:

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Javascript help require

2004-06-26 Thread Manuel Lemos
Hello,
On 06/26/2004 11:04 AM, Rinku wrote:
I need Javascript help for this
1)I want to validate a variable called "name"
If variable's value is not set then system should say
"Value require".
If its not alphabatic then system should say
"Alphabatic value require". And curser's focus should
come on textbox named "name".
2)I want to validate a variable called "Phone_no"
If variable's value is not set then system should say
"Value require".
If its not numeric then system should say "Numeric
value require". And curser's focus should come on
textbox named "Phone_no".
You may want to try this forms generation and validation class that can 
do exactly what you ask.

http://www.phpclasses.org/formsgeneration
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Validation Form require.

2004-07-04 Thread Manuel Lemos
Hello,
On 07/04/2004 03:57 AM, Rinku wrote:
Can any of you send me one of your validated form for "Numeric value checking" & "Alphabetic Value Checking" I have done it but still not succeed.
You may want to try this class for forms generation and validation. It 
provides built-in support for those types of validations that you 
specify and more. It can validate both on the client side with 
Javascript code generated by the class and on the server side with the 
PHP class itself. It comes with examples that demonstrate how to do that:

http://www.phpclasses.org/formsgeneration
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: map algorithm

2004-07-13 Thread Manuel Lemos
Hello,
On 07/07/2004 03:41 PM, Matt Perry wrote:
I have written a shortest point algorithm that takes a number of 
addresses and finds the best delivery route.  Yahoo maps finds the 
distances between two addresses but I cannot seem to find out how to 
grab the results and use them in my algorithm. How should I approach 
this problem?
You may want to try this class that includes an example to solve that 
problem with combinatorial analysis:

Class: Combinatorics
http://www.phpclasses.org/combinatorics
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: generating reports in php

2004-07-28 Thread Manuel Lemos
Hello,
On 07/28/2004 05:50 AM, Carlos Merino wrote:
hi,
   Is there any product to create reports in an easy way like Crystal 
Reports or Access?
I want to create a report that can be stored in XML and I want to insert 
this reports
to be web available. Advices??
Try Agata reports:
http://www.agata.org.br/
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: sendmail

2004-08-03 Thread Manuel Lemos
Hello,
On 08/03/2004 11:16 AM, Aaron Todd wrote:
Is there any tweaking with mail()?
I have it working, but it seems to not always send the email.  Mainly one
right after the other.  I filling a web form and then sending the data off
to my email.  But then I do a refresh to clear the form and do it again with
different data and it doesnt work.  Any ideals on this?
"It doesnt work" is vague. What happens? Does it show any error? The 
message does not arrive?

--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: sendmail

2004-08-04 Thread Manuel Lemos
Hello,
On 08/04/2004 09:47 AM, Aaron Todd wrote:
I dont know how to be more specific.  It just doesnt work.  There is no
error.  The program runs and sometimes it sends the email and sometimes it
doesnt.  I've looked at all the log files that I know about and havent seen
anything that looks like an email error.  Is there any other troubleshooting
that I can do to get more information on what I am doing?
It is very likely that the message is being bounced to the return path 
address, which is set with the mail() 5th parameter.

If you are not sure how to do it, take a look at the examples of this 
message composing and sending class that let you set it using the 
Return-Path header:

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: MAIL() help needed :-(

2004-08-09 Thread Manuel Lemos
Hello,
On 08/09/2004 01:25 AM, Chris Payne wrote:
I'm having a major problem.  I'm trying to send a message FROM Windows XP
Pro, now this is where it get weird - in some mail packages it WORKS, and in
some it doesn't.  Basically it's an HTML email which is sent when a form is
completed, the results are stored in a DB and then sent on in an HTML Email
Format.  In My outlook 2003, it works, in my friends outlook 2003 which I
setup for him exactly the same way mine is - the email is blank, it is the
same in his outlook express.  My question is, can anyone see anything that I
am doing wrong for this to happen?  Maybe my headers are wrong?  Any help
would be really appreciated as this is really getting to me.
Apart for taking the $body_html from the headers definition, you should 
not be sending literal text/html messages.

Many mail systems, including Hotmail will tag your message as spam 
because real mail clients always compose HTML messages with an 
alternative plain text part in the same body.

The reason for that is that sending literal text/html messages is a 
pattern of messages sent by some spammers.

What you need to do is to compose multipart/alternative messages that 
include both a text/html and text/plain part. If you do not know how to 
do that you may want to take a look at this message composing and 
sending class that includes an example to do exactly that:

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: How to forward a POSTed form to another server and catch the return for further processing

2004-08-14 Thread Manuel Lemos
Hello,
On 08/14/2004 09:41 PM, Yanglong Zhu wrote:
How to forward a POSTed form to another server and
catch the return for further processing.
I think I did this before. But now I have completely
forgot how that was done. The posted form data is
processed on the other server, the results should be
returned or captured by the first server. Obviously my
brain is not working.
You may want to try this HTTP client class that can do exactly what you 
want which is emulating browser POSTing a form. It comes with a specific 
example that explains how to configures everything that you may need.

http://www.phpclasses.org/httpclient
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: SMTP

2004-08-17 Thread Manuel Lemos
Hello,
On 08/16/2004 11:54 PM, [EMAIL PROTECTED] wrote:
In the Outgoing Mail Server section, click the My server requires 
authentication check box. 
Click Apply. 
Click the Advanced tab. 
In the Outgoing mail (SMTP): field, change the number that displays to 587. 
If you need to authenticate, you can't use the mail() function. You may 
want to try this class that comes with a wrapper function named 
smtp_mail(). It works like the mail() function except that it lets you 
specify the authentication credentials so you can use that server.

http://www.phpclasses.org/mimemessage
You also need this:
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: E-mail as HTML

2004-08-25 Thread Manuel Lemos
Hello,
On 08/26/2004 01:44 AM, Hafidz Abdullah wrote:
In PHP, how do I submit data by e-mail as HTML to a specified
address? And where can I find samples of that in http://www.php.net/
?
You need to compose a multipart/alternative message that includes an 
HTML part and a text part for e-mail clients that do not support HTML 
only messages. You need to do this even if you do not care for users 
with mail clients that do not read HTML messages, otherwise many spam 
filters will filter your message.

If your message contains non-ASCII characters, you also need to encode 
the messages as with quoted-printable encoding.

This is not trivial but fortunately there are some ready to use 
components to do that for you. I recommend that you try this class that 
even comes with an example the explains how to embed images in the HTML 
messages if you want.

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Dear php experts

2004-08-29 Thread Manuel Lemos
Hello,
On 08/29/2004 02:06 AM, Bishnu wrote:
I am new in PHP. I've just started programming with php. I am going to build a 
newsletter mailing of my own community.
I use a table where members' name, email and other information is stored. I would like 
to send email to all member listed on member table. Could anyone give me functional 
code for it?
If you want to send personalized messages (or not) to many users, you 
may want to try this class is that provides some optimization support 
for bulk mailing:

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-11 Thread Manuel Lemos
Hello,
On 09/11/2004 11:11 PM, Hans Lellelid wrote:
/abstract/ stuff.  For example, ADOdb would completely fail to be 
portable accross databases where the case of the column names in 
result array changes (e.g. postgres always returns lowercase col 
names, Oracle always uppercase, MySQL returns mixed case, SQLite is 
configurable). This is one example of why some layers (like 
PEAR::[M]DB) may be slower.
This is incorrect. You can configure the case of the column names in 
ADOdb. See 
http://phplens.com/adodb/reference.constants.adodb_assoc_case.html
 >
Sorry about that.  I certainly don't want to spread disinformation (!) 
Is this true for all the drivers ... ?  E.g. I looked at the postgres64 
driver and saw no case-changing code in the MoveNext() method; I didn't 
look at the other drivers after that, though.
You are right Hans, there is no completely portable solution for 
returning result set rows as associative arrays. Even if you waste time, 
mapping the case of column names, there is also a problem that you did 
not mention that is that there are some databases than mangle column 
names larger than a certain limit.

For this there is no solution. Even you bother to waste even more time 
parsing the original query and are aware of the exact column name limit, 
there is always the chance that two distinct columns are returned with 
the same name because they differ only in characters after the limit.

This is why I never accepted suggestions to add a function to retrieve 
result sets as associative arrays to Metabase despite many requests.

I am not sure about the column name length limits of all databases, but 
if I am not mistaken Oracle's is limit is low. This is also part of the 
reason why I decided to not bother to implement ROWNUM based tricks in 
Metabase Oracle driver to implement a row range limiting based on 
parsing the query like Thomas Cox implemented for PEAR-DB and John Lim 
copied for ADO-DB.

Actually the advice to not play with tricks of doubtful feasibility came 
from PHP Oracle gure Thies Arntzen. Chances are that soon or later an 
users of your database abstraction package will find an hairy query that 
will break those tricks and will be mad and stuck with feature that does 
not work.

--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Sending mail through localhost

2004-09-17 Thread Manuel Lemos
Hello,
On 09/17/2004 04:52 AM, W Roothman wrote:
Dear All,
Do I need to install a mail server, such as ArGoSoft Mail Server, on my computer (MS 
XP) in order to prevent this error when sending mail through a form (ref: N: Mail 
functions, PHP manual):
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] in c:\inetpub\wwwroot\..sendfeeback.php on line 22
That message means that you need to authenticate to relay the message to 
your SMTP server. The mail function does not support authentication.

You may want to try this class that comes with a wrapper function named 
smtp_mail() . It works exactly like the mail() function but it lets you 
configure the authetication credential so you can relay your messages.

http://www.phpclasses.org/mimemessage
You also need this:
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Abstraction Layer....

2004-09-19 Thread Manuel Lemos
Hello,
On 09/19/2004 02:32 PM, M Saleh Eg wrote:
Anyone for a list of php abstraction classes?
ADODB, PEAR::DB... any others? or better?
Metabase
http://www.phpclasses.org/metabase
PEAR::MDB
http://pear.php.net/package/MDB
Creole
http://creole.phpdb.org/
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Mass mail

2004-09-20 Thread Manuel Lemos
Hello,
On 09/20/2004 10:18 AM, Nikos wrote:
A client of mine sends thousands of mails as newsletters and wants as to
make an Interface to admin this list. Its easy to put this mail list in
a MySQL table and make the interface on PHP language and with mail()
function to send a newsletter.
The question is that if this function can handle a thousand mail or more
or there is a most appropriate way
It depends. PHP mail() function relays on an SMTP server on Windows and 
on the sendmail wrapper program on Unix/Linux. Relaying on an SMTP 
server is slow and inefficient. If you can use a platform that uses 
Qmail or Postfix you are fine. Using sendmail or exim can also be a good 
solution but you need to configure how the messages are queued or else 
your PHP script will be running for a very long time.

Now, for the actual composing and sending of the newsletters, there are 
some optimizations that can be done depending on whether the newsletters 
 are going to be personalized (avoid it at all costs if you can) or not.

You may want to take a look at this class that provides some means to 
optimized deliveries for bulk mailing. I use it to send over 100,000 
every day.

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: Mass mail

2004-09-20 Thread Manuel Lemos
Hello,
On 09/20/2004 11:54 AM, Ben Galin wrote:
Now, for the actual composing and sending of the newsletters, there 
are some optimizations that can be done depending on whether the 
newsletters  are going to be personalized (avoid it at all costs if 
you can) or not.

May I ask why?  Are you referring to the additional time it would take 
the script to run or to a security issue or something else?
Yes, it takes much more time to send personalized messages because you 
have to generate different copies for each recipient.

What I mean is that IMHO it is not worth to send personalized messages 
just to adapt the "Hello {name}" header unless you want to pretend that 
the messages are being sent by a human that really cares about the 
recipient person and not a bulk mailing machine.

--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: Mass mail

2004-09-20 Thread Manuel Lemos
Hello,
On 09/20/2004 11:54 AM, Ben Galin wrote:
Now, for the actual composing and sending of the newsletters, there 
are some optimizations that can be done depending on whether the 
newsletters  are going to be personalized (avoid it at all costs if 
you can) or not.

May I ask why?  Are you referring to the additional time it would take 
the script to run or to a security issue or something else?
Yes, it takes much more time to send personalized messages because you 
have to generate different copies for each recipient.

What I mean is that IMHO it is not worth to send personalized messages 
just to adapt the "Hello {name}" header (and the rest of the message is 
the same) unless you want to pretend that the messages are being sent by 
a human that really cares about the recipient person and not a bulk 
mailing machine.

--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Using PHP to generate SQL statement

2004-09-23 Thread Manuel Lemos
Hello,
On 09/23/2004 03:46 AM, Ed Lazor wrote:
I keep looking at the following code and thinking there's gotta be a better
way.  I've been in front of the computer all day tho and I'm drawing a
blank.  Any ideas?
You may want to consider a Data Access Objects (DAO) class generator.
DAO classes encapsulate the storage and retrieval of data in database 
table rows as objects of associated classes. Each retrieved row is 
mapped to an object of a DAO class. The row columns are mapped to class
variables.

Since usually DAO classes are tedious to implement by hand, you may want 
to try this PHP DAO generator tool that lets you define your DAO classes 
in a simple XML format including variables, validation rules, 
relationships and functions that you need to manipulate your data 
objects and it generates all the code for you:

http://freshmeat.net/projects/metastorage/
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: microsoft access

2004-09-30 Thread Manuel Lemos
Hello,
On 09/30/2004 11:28 PM, Matthew Perry wrote:
Does anyone know of a good online source for using php and microsoft 
access. I don't want to have to use asp.
Basically, you need to use ODBC but each database supported by ODBC has 
its own features that require database specific treatment.

You may want to try this database abstraction package that comes with 
Access driver so you can access it in a database independent way:

http://www.phpclasses.org/metabase
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: sending e-mails

2004-10-21 Thread Manuel Lemos
Hello,
On 10/21/2004 07:19 PM, Miguel Guirao wrote:
I have a script in PHP that should send an e-mail from a specific e-mail
account, let's say  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
to a customer's e-mail account, using the smtp_mail.inc class of PHP.
But, Do I need to authenticate first in order to send the e-mail? If so,
how?
I don't know what is that smtp_mail.inc class but if you use this class 
that comes with a wrapper script named smtp_mail.php you can send 
messages via an SMTP server that requires authentication. Just configure 
the user name and password within that script.

http://www.phpclasses.org/mimemessage
You also need these classes.
http://www.phpclasses.org/smtpclass
http://www.phpclasses.org/sasl
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Book recommendation for using MySQL w. PHP

2004-11-03 Thread Manuel Lemos
Hello,
On 11/04/2004 01:22 AM, -{ Rene Brehmer }- wrote:
Any recommendations for a book that goes into depth with the SQL 
language and specifically MySQL's variant, and especially using that 
with PHP 

I don't need a beginner's guide, cuz I've gotten far beyond that on my 
own, but I need some help at figuring out the more complex 
possibilities, and how to put them into practical use, with both the PHP 
commands and the SQL language itself.

I'm primarily using MySQL, and want to learn that properly, before I 
start moving on to PostGres and the others...

Any recommendation would be beneficial, thanks alot in advanced :). 
Christmas is coming up, and my girl wants to know what to give me ... 
heh :P
You may want to take a look here for some of the books like you want 
including reviews:

http://www.phpclasses.org/reviews/
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Mailing Attachments (like csv file)

2004-11-04 Thread Manuel Lemos
Hello,
On 11/04/2004 12:46 PM, Terri Slater wrote:
  Does anyone know of a good php script to e-mail attachments, like a 
csv file?  I want it to come across as an attachment so that it shows as 
one in the mail client.
You may want to try this class that lets you compose and send messages 
with as many attachments as you want.

Just take a look at the attachment sending example, and in the 
Content-Type attachment definition change from automatic/name to 
application/octet-stream  .

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Prevayler in PHP

2004-11-04 Thread Manuel Lemos
Hello,
On 11/04/2004 11:27 AM, Devraj Mukherjee wrote:
Is there anyone out there who knows of a Prevayler implementation for 
PHP? Please let me know as I am going to set off on writing one for PHP.
This is not really like Prevayler, but you may want to try Metastorage 
which is a persistence layer generator tool:

http://www.meta-language.net/metastorage.html
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: php newsletter with mysql data

2004-11-22 Thread Manuel Lemos
Hello,
On 11/22/2004 06:00 AM, Bishnu Prasad Dahal wrote:
> I have to create a newsletter for a site
> http://www.migratetousa.com , I didn't code for any newsletter. could
> you suggest me how can I design the newsletter? And please send me
> sample php codes for newsletter
Just compose it as an HTML or plain text message, query the list of 
recipient addresses and iterate over it to send a message to each of the 
subscribers.

Mailing many recipients may take a long time, so you need to run the 
mailing script from the shell (DOS) command line using the PHP CLI/CGI 
version and override the script time limit.

Composing and sendind the messages correctly to many recipients is not a 
trivial task, but you may count on classes like this that not only makes 
it simple but also has options to optimize the deliveries and take less 
time to queue the messages to all the recipients:

http://www.phpclasses.org/mimemessage
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: connection pooling

2004-12-05 Thread Manuel Lemos
Hello,
On 12/05/2004 05:42 PM, Jan Bro wrote:
is there anybody out there, who could help me in finding something I know
from good old java: Connection Pooling.
Is there a mechanism or project that provides that for PHP 5? Reason I
create a 20 page pdf with data out of MySQL 4.1
(that means using the mysqli methods) where I require a couple of shots at
my database. The whole process is realy slow
and i think the bottleneck is the database connection.
That has nothing to do with connection pooling. Connection pooling only 
makes your database accesses slower. They are meant to handle more 
simultaneous users but that does not seem to be your problem.

What you need to do is to benchmark and profile your scripts to see 
which parts are consuming most of the time. If it turns out to be the 
actual MySQL queries, you need to optimize them eventually using indexes 
or avoiding expensing SQL expressions. If the problem is on the PHP 
side, you need to see what your code is doing to make it do it faster.

--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: PHP Classes to generate Excel files ?

2004-12-22 Thread Manuel Lemos
Hello,
on 12/22/2004 11:19 AM Stéphane pinel said the following:
I'm looking for PHP classes (free or cheap) that are able to generate 
Excel files (XML?) with a minimum
of customization capabilities (styles, borders, colors...).

Any idea ?
You may want to try this one. It won an innovation award as it makes 
creating Excel files as simple as opening files with 
fopen("xls://path/to/spreadsheet.xls") and the use fwrite(). You need at 
least PHP 4.3.0 to use this.

http://www.phpclasses.org/xlsstream

--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Site optimization

2004-12-28 Thread Manuel Lemos
Hello,
on 12/28/2004 02:50 PM [EMAIL PROTECTED] said the following:
While my PHP/MySQL-based sites work quickly on my development
computer, as well on servers where I know the traffic load is low,
I'm concerned about how they'll perform under heavy loads, and
whether or not I need to simplify MySQL queries or PHP code in order
to speed up page delivery.
Does anyone have any suggestions as to how to simulate site
performance under heavy traffic load, and then, should results be
poor, how to optimize code to perform better?
You may want to try the ab program that comes with Apache.
This may sound curious, but the best way to speedup database driven 
sites is to avoid database accesses as much as possible.

What I do to reduce the eventual performance penalty as the site 
audience increases is to determine which pages lead to more repeated 
SELECT queries and use server side caches to reduce the need to execute 
such queries.

For instance, if you have a content site, the content page scripts tend 
to execute the same queries over and over again. This is the kind of 
queries that can be optimized away by employing a server side cache system.

I use this generic cache class to store cached the pages in server side 
files. Since the class can store generic data I can cache either full 
pages, just some parts of the pages or even the contents of variables or 
query result sets arrays by using the PHP serialize/unserialize 
functions to store the variables data as a single string.

The class lets me set a expiry period or a date to determine when the 
cached data is no longer valid and forcing the cached data to be 
regenerated next time it is accessed.

However, I use a more efficient way manage cached data that consists in 
calling a function of the cache class named voidcache that simply 
removes the cache data in a safe way, when the site executes some 
operation that updates cached content in the database.

This class is very robust as it employs safe locking to prevent that 
simultaneous accesses attempt to update the cache file at the same time, 
thus avoiding eventual corruption.

I started using this class because I have a site that started growing so 
much in popularity, that I had to save as much queries as possible on 
every content page. Currently, this site uses over 35,000 cache files to 
save as much database queries as possible.

The class and its support forum is available here:
http://www.phpclasses.org/filecache
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Slow Query

2005-01-12 Thread Manuel Lemos
Hello,
on 01/12/2005 08:48 PM Wendell Frohwein said the following:
I was hoping on the based on the operation of the script, someone would
suggest a better and faster way to search zip code radius, while
matching the results to agents within the system.
I assume you are using a script like this that computes the geographic 
distance to each zip code in the database:

http://www.phpclasses.org/phpziplocator
The problem of the computing the distance to each zip code in the 
database is that it prevents the use of any index and so it leads 
inevitably to a full table scan. The more zip codes in the database, the 
worst it gets.

A more efficient solution would use a range clause to exclude all zip 
codes with coordinates that are farther than the desired radius 
considering only the longitudinal and latitudinal distance separately. 
This would allow the use of eventual indexes in the latitude or 
longitude fields to avoid full table scan.

This is more like the approach of this other class despite in the end it 
does not consider the actual radial distance like the class above.

http://www.phpclasses.org/zipcodesrange
I am not sure if these explanations were clear to you. Just take a look 
at the classes and let me know if you got the idea.

--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Mail question

2005-02-19 Thread Manuel Lemos
Hello,
on 02/14/2005 04:12 PM ReClMaples said the following:
I have a quick, probably easy to answer question.  I am trying to add the
ability to email from like a quest book or a calendar event and get an
authentication error in my error log.  I can only believe that this is due
to my smtp server needed to know my login and password.  Is there a way I
can pass this in the php.ini file?  I am using apache 2.0 and PHP 4.03 on a
windows xp machine.  If this can be done, please let me know, any other
suggestions would be welcomed.
The mail function does not support SMTP authentication.
You may want to try this class that comes with a wrapper function named 
smtp_mail(). It is a direct replacement of the mail() function that lets 
you send messages to any SMTP server that requires authentication.

http://www.phpclasses.org/mimemessage
You also need these:
http://www.phpclasses.org/smtpclass
http://www.phpclasses.org/sasl
--
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: [PEAR-DEV] Re: [binarycloud-dev] Re: [PEAR-DEV] Re: [metabase-dev] RE: [PEAR-DEV] New Metabase Aniversary release

2002-01-25 Thread Manuel Lemos

Hello,

Björn Schotte wrote:
> 
> * Stig S. Bakken wrote:
> > this effort.  I don't understand why this is an issue for you, could you
> > explain?
> 
> I already explained it several times.

I understand your concern of this PEAR-DB x Metabase merger may open a
precedent that will motivate others to come along with their components
and propose mergers with other PEAR-DB components.

I think that is a good precedent because it will let PEAR components
implementations evolve, of course by keeping backwards compatibility to
not break the applications of people that rely on the current
implementation of PEAR components.

Of course, like with PEAR-DB x Metabase, no component merger should
happen if the interested parties do not agree with the terms of merger.
If a favourable decision is made, it should be because the agreed merger
terms were beneficial to the interested parties.

Here interested parties means, the proposing authors and some PEAR
representatives preferrably elected in a democratic process to evaluate
proposals and make decisions regarding them. Currently there is nobody
elected as PEAR representative but if I got it right it should happen
some time soon.

Regards,
Manuel Lemos

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




Re: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-28 Thread Manuel Lemos

Hello,

Boaz Yahav wrote:
> 
> I don't think you realize the nature of the site. Its an auction site
> and not a retail site.
> Prices need to be updated on thousands of clients simultaneously. Our
> goal is to
> refresh the data on the client every 3-10 seconds while having 1500
> online open
> auctions.
> 
> This is quite a mess :)

humm I am afraid that goal may be a bit unrealistic for your budget.
I suggest that you cache as much content as you can to avoid hitting the
database.

One technique that I use in the PHP Classes site is to cache content
indefinitly. Then when the data that defines that content is changed I
call a method of my cache file class to void the cache, so it will force
the cached data if and when it is needed on the next access for a page
that uses that. This way I don't retard the database update process and
the cache is only generated if it will ever be need. So I avoid having
situations where more than one update is made to the database before the
cached data needs to be redisplayed.

For making your site static as much as possible, I usually recommend the
"page fault" technique. That consists of static pages that are deleted
when their content is updated. When there is a request for them, since
when they are missing the server redirects the request to your error
document. That is where you regenarate the page file with upto date
data. While the page is upto date it remains in the disk and is served
as static page at the server top speed (no scripting language nor
database to clutter the access).

Regards,
Manuel Lemos

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




Re: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-28 Thread Manuel Lemos

Hello,

Boaz Yahav wrote:
> 
> Fail Over is not for when the cluster is too busy, it's for when the
> server dies, or when someone killed it's power, or when you loose your
> network, or when you get a blue screen (assuming you are on windows :).

Ok, it is the same. When the server is dead, the response is the same:
none.


> Then, in about 30 seconds the cluster will do a fail over to the 2nd
> node and the site will continue to work as if nothing happens... it's
> pretty amazing to see this in action :)

I had requests to implement that in Metabase. The problem is that PHP
database connection functions do not let you define the connection
timeout parameters or check if the current persistent connection is
still alive. Anyway, nothing that a good middleware could not do better
for you.

Regards,
Manuel Lemos

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




[PHP-DB] Re: Cross DB application

2002-04-15 Thread Manuel Lemos

Hello,

"Arcadius A." wrote:
> 
> Hello !
> I'm planning to write a database application for  MySQL, and then port it to
> PostrgeSQL.
> Is there any library or class that could help me to write/maintain just one
> source code for both MySQL and PostgreSQL ?

I think your best (if not the only) option in PHP is Metabase.

http://www.phpclasses.org/metabase

This is a PHP databases abstraction focused on application portability.
AFAIK, it is the only one that provide complete and true data type
abstraction. This means that for instance if you have to deal with dates
in your application, Metabase assures that you only have to deal with a
single date format (ISO 9601 - -MM-DD HH:MM:SS) even if the
underlying databases use other formats. So, when you switch to a
different database, you do not have to touch a single thing in your
application other that the choice of database type option.

Metabase goes farther, it also abstracts database schema installation
and maintenance. This means that it provides a way to describe a schema
of database tables, fields, indexes and sequences using a simple XML
syntax. Then the Metabase manager class will install it for you in the
target database that you use. If you move to another database, Metabase
can export the database contents in the same XML format and then you may
reinstall the schema in the new database type without loosing
information.

Here it is an example of a Metabase schema:

http://www.phpclasses.org/browse.html/file/59.html

Regards,
Manuel Lemos

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




Re: [PHP-DB] Cross DB application

2002-04-15 Thread Manuel Lemos

Hello,

Andrew Hill wrote:
> 
> ARcadius,
> 
> You may use an abstraction library such as PEARDB or ADODB, or
> simply the unified ODBC functions.

Andrew, you always suggest ODBC as a good solution for portable database
application development, but AFAIK it is not a good solution at all
because for crucial things you still have to resort to database specific
code to handle database differences.

I already asked you this before but I don't recall ever getting a
satisfactory answer. I don't know if the problem is in PHP ODBC API or
is really an ODBC limitation, but for instance, when you want to
implement auto-incremented sequences of integer values that are
fundamental for database aplications to use in primary key fields, with
ODBC you there seems to be no database independent way to create and
retrieve the next sequence value.

The other important issue, especially for Web development, is query
results paging. In most current databases there some clause like for
instance MySQL LIMIT. Others use different syntaxes or clause for
restricting the range of rows that are returned by the server to the
client. This is importa, especially when you want to show a small number
of rows of a very large result set.

Once you suggested to use ODBC cursors, but that is not the same as
limiting the result rows in the actual queries. For instance, if you
need to get the first from row 10 to 19 of a result set of 1.000.000
rows, using the LIMIT clause will make the server stop the query after
20 rows. Using cursors, AFAIK will not stop the query making the
database server hog the machine needlessly to traverse 1.000.000 rows of
data that an application is not interested in.

I don't know if there are better and portable solutions using PHP ODBC
API functions, but with your ODBC knowledge is there a way to solve
these issues with a complete ODBC API (besides what PHP ODBC API can
offer)?

I would like to make a better ODBC driver class for Metabase so users
can develop portable database applications using Metabase via ODBC, but
it seems that I will have to develop subclasses for each type of ODBC
data source (MS Access, IBM DB2, SAP-DB, etc...) to handle database
specific issues that the ODBC API does not handle by itself.

Regards,
Manuel Lemos

Regards,
Manuel Lemos

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




[PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-15 Thread Manuel Lemos

Hello,

James Cox wrote:
> > I'm planning to write a database application for  MySQL, and then port it
> to
> > PostrgeSQL.
> > Is there any library or class that could help me to write/maintain just
> one
> > source code for both MySQL and PostgreSQL ?
> 
> I think your best (if not the only) option in PHP is Metabase.
> 
> http://www.phpclasses.org/metabase
> 
> 
> 
> you could also use PEAR (http://pear.php.net/) which has a more than
> adequate abstraction layer for various databases.


PEAR does not offer a good means of writing portable database
applications because it does not have data type abstraction support.

This is important because different databases represent data types
differently. For instance, Oracle, unlike other databases, does not have
individual time and date field types, only a single type that represents
both a full timestamp with time and date. This means that if you just
want to store a date on the field you have to use the whole timestamp
field and discard the time part. Metabase handles that for you. PEAR
does not provide any support for this level of database portability.

I think this is an important point to mention about this limitatation of
PEAR because I noticed that a lot of people that use PEAR did not know
about it because they develop applications that only deal with text and
integers that need little or no conversion, besides any eventual
quoting.

As soon they need to use other data types like date and time, when they
need to run their applications in different databases, they realize that
PEAR was not a good idea because, unlike Metabase, it doesn't handle
datatype representation format differences.

This may not be a problem for you James, but it is a problem for a lot
of database developers that really care about portability because it
costs a lot of time and money to maintain the applications that need to
work with different databases if you have to tweak your application to
handle the differences of the databases.

This is the main reason why Java JDBC provide such an high level of
database application portability, that in the PHP world only has
parallel with Metabase.

 
> But, I doubt even metabase can rewrite your SQL queries for you so that it's
> optimized for postgres AND mysql (and any other option you would like to
> choose).

Metabase does not rewrite queries. You need to know Metabase better. It
just converts datatypes of between a database independent format that
applications use and the native database datatype format, if and when
the develop wants that.

 
> you're much better off either picking one DB system, or use both but
> maintain seperate SQL for each, to provide full optimization.

If the original poster would not mind to have the major headache of
doing that, he would not have posted, don't you think?

Regards,
Manuel Lemos

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




[PHP-DB] Re: Definitive answer for large scale registration/authentication

2002-04-15 Thread Manuel Lemos

Hello,

Brad Hubbard wrote:
> 
> Can I get some feedback on the conventional wisdom as to the best solution
> for high volume registration and authentication of users accessing a secure
> site? I have worked before with database/session based methods as well as
> htaccess. Which is preferred? Are there alternatives?

Probably the fastest way to keep session profile information is by
serializing the data array into a string that will be encrypted and then
stored in cookie. The security weakness of this method is that if the
secret key leaks, hackers may use to forge new sessions.

A more secure but eventually less scalable method is to store the
session data in a shared memory cache, so you minimize database accesses
to just one after the server is restarted. This is probably the one you
want to use as long you know how to deal with shared memory and
semaphores.

Regards,
Manuel Lemos

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




Re: [PHP-DB] Re: Definitive answer for large scale registration/authentication

2002-04-15 Thread Manuel Lemos

Hello,

Brad Hubbard wrote:
> 
> On Tue, 16 Apr 2002 14:01, Manuel Lemos did align ASCII characters thusly:
> > Probably the fastest way to keep session profile information is by
> > serializing the data array into a string that will be encrypted and then
> > stored in cookie. The security weakness of this method is that if the
> > secret key leaks, hackers may use to forge new sessions.
> 
> Is this documented anywhere?

Yes, but where I know I can't tell you because it is part of a
proprietary system. Maybe somebody else did it like this and documented
somewhere but I have no knowledge of that. Anyway what part didn't you
understand?


 
> > A more secure but eventually less scalable method is to store the
> > session data in a shared memory cache, so you minimize database accesses
> > to just one after the server is restarted. This is probably the one you
> > want to use as long you know how to deal with shared memory and
> > semaphores.
> 
> Is this documented anywhere?

Probably only in my mind . :-)


> My understanding was that htaccess authentication was more secure that
> session based because of the porblems of session hijacking???

I guess you mean HTTP based authentication. No, AFAIK that is very
unsecure because you can't end a "session" because browsers cache
authenticated passwords and only drop them (of they do, IE may not do
it) when you quit your browser. If you leave your browser terminal for
some time, somebody may come in and take advantage of your account
privileges.

Regards,
Manuel Lemos

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




Re: [PHP-DB] Re: Definitive answer for large scale registration/authentication

2002-04-16 Thread Manuel Lemos

Hello,

Brad Hubbard wrote:
> 
> On Tue, 16 Apr 2002 14:51, Manuel Lemos did align ASCII characters thusly:
> > > > then stored in cookie. The security weakness of this method is that if
> > > > the secret key leaks, hackers may use to forge new sessions.
> > >
> > > Is this documented anywhere?
> > Anyway what part didn't you
> > understand?
> 
> I think I understand all of it. Serialization of a session (or session
> object) is fairly straightforward and I know how to store that in a cookie. I
> was just hoping there was a "cookbook" out there. Don't have any classes on
> your site that do this do you?  ;-)

Oh, sure, lots of them. It just depends on what exactly you would like
to see. Why don't you just take a look around to see if you find what
you want?

Here you may see all in there about authentication and sessions.

http://www.phpclasses.org/browse.html/class/21.html

Actually it could be simpler like this:

http://www.phpclasses.org/sessions

http://www.phpclasses.org/cookies

http://www.phpclasses.org/authentication

As for cookbook, you may want to take a look at Sterling's PHP Cookbook.
Sterling is "nuts", but the book is good and has an whole chapter on
sessions and another on LDAP which maybe an option depending on exactly
you want to do. 

http://www.phpclasses.org/products.html/id/0672319241.html

Talking about books, the new Professional PHP 4 Programming is also a
very good book that addresses these issues. I have just reviewed it and
all I can say is that WROX books really rocks! :-)

http://www.phpclasses.org/products.html/id/1861006918.html


> > > > accesses to just one after the server is restarted. This is probably
> > > > the one you want to use as long you know how to deal with shared memory
> > > > and semaphores.
> > >
> > > Is this documented anywhere?
> >
> > Probably only in my mind . :-)
> 
> Can I borrow it

I'm afraid I need it now. Try again in a few decades maybe. :-)

Seriously, there is no big deal about it. It was also mentioned that
PHPlib seems to do that already, although I never tried it.

 
> > I guess you mean HTTP based authentication.
> 
> Yes.
> 
> > No, AFAIK that is very
> > unsecure because you can't end a "session" because browsers cache
> > authenticated passwords and only drop them (of they do, IE may not do
> > it) when you quit your browser. If you leave your browser terminal for
> > some time, somebody may come in and take advantage of your account
> > privileges.
> 
> The physical security of the users machine is their responsibility. I'm
> looking for good security, ease of implementation, and scalability.
> 
> At the moment it seems to be a case of "pick any two".

Suggestion: design an API maybe implemented as a PHP class that handles
the basic functionality that you want to implment. Then you may choose
an initial approach having in mind that in the future you may evolve
your API implementation that address better those items. That way you
won't have to rewrite your application because your API is the same.

Regards,
Manuel Lemos

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




[PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-16 Thread Manuel Lemos

Hello,

Richard Ellerbrock wrote:
> >> I'm planning to write a database application for  MySQL, and then port
> >> it
> > to
> >> PostrgeSQL.
> >> Is there any library or class that could help me to write/maintain just
> > one
> >> source code for both MySQL and PostgreSQL ?
> >
> > I think your best (if not the only) option in PHP is Metabase.
> >
> > http://www.phpclasses.org/metabase
> >
> > 
> >
> > you could also use PEAR (http://pear.php.net/) which has a more than
> > adequate abstraction layer for various databases.
> 
> Another alternative (that does not require you to login before you can
> download) and that promises all the functionality that Metabase does and
> more is AdoDB (http://php.weblogs.com). It is also released under the LGPL which
> allows you to use it in commercial applications.

I notice a few inaccuracies here.

1) ADODB still has to "run" a lot until it has all the functionality of
Metabase, especially when it comes to portable database development.
Just a few examples:

- Schema management - Metabase is the only database abstraction package
(in PHP or anything else) that lets you define a database independent
schema definition of tables, fields, indexes and sequences using XML.

>From them on, Metabase installs and maintains the schema for you in your
database of choice. If you want to migrate a schema and any data already
stored in a database installed by Metabase, it can export the schema and
data in a single XML file of the same format so you can use it and
re-install it in a new database without loosing information. This
directly addresses a need of the original poster.

This is a remarkable and unique capability of Metabase. Soon there will
be even a book written by several developers about PHP and XML that has
a whole chapter dedicated to Metabase and this outstanding use of XML
for a very useful purpose.


- Prepared queries - this is meant to execute queries that are
pre-compiled. After you process a prepared query you may execute it once
or more times eventually changing the values of some constant parameters
in the query.

Metabase prepared queries support may convert data types so the values
match the underlying database data type representation format.

Prepared queries in practice are the same as what John Lim calls in this
document http://php.weblogs.com/portable_sql as "binding", except that
he doesn't seem to be aware that it is the same thing, so he says that
only some database can use it! :-) Metabase handles prepared queries
with ALL supported databases.

- LOB data streaming - Large OBject fields (AKA LOBs) are fields meant
to store large amounts of data. ADODB has limited supported to LOBs.
Either you have all data in memory or in a file. This is inadequate
because if you need to insert large ammounts of data, you may simply
exhaust your computer memory.

Metabase has a streaming interface for LOBs. You can read or write data
to LOBs in data chunks of limited size so you don't take too much
memory. You can even query a table with LOB fields and update or insert
in another fields pulling data directly from the selected field.

Metabase implements LOB in all supported databases that have this kind
of fields, which is what matters to the original poster.

2) LGPL is not a good Open Source license for commercial companies. It
lets you use LGPL'd software in commercial companies without
contaminating them, but if the company needs to change anything in the
LGPL, you are required to publish those changes. Like RMS says, it's
Free as in freedom of speech, not as in free beer! So, basically it has
a cost for companies that is to have to disclose the know how and work
time invested on the changes that they make.

A better license for companies that sell commercial applications using
Open Source software is BSD. It is better because it is not tying as
LGPL. You can do anything with the code including modify and distribute
(sell) it with the modifications without have contribute back your
changes. Metabase uses the BSD license.


Last but not least, PHP ADODB is an attempt of John Lim to develop
something of his own copying ideas and names from everywhere and cash on
it by selling PHPLens. He copied Microsoft ADODB to appeal better to
Windows users. But since ADODB was not meant specifically for portable
Web development, he still needed to copy features of Metabase like
auto-incremented integer sequence values and limiting the range of rows
returned in select queries result sets. Some of these things that were
copied had their names changes to not look so obvious but they are still
copies of Metabase features because only Metabase provided them before.

Anyway, if you are thinking of using something that is just a limited
copy of something, why not use Metabase, the original, and stil benefit
of all the features that PHP ADO DB misses?

Regards,
Manuel Lemos

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




Re: [PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-18 Thread Manuel Lemos

Hello,

Sp wrote:
> 
> Can someone with database expertise who has used metabase and adodb cut
> through this rhetoric and give an objective view of these two packages.
> From what I got from this convo is that metabase is slower but more portable
> but adodb is faster but not as portable.

No, Metabase does much more than ADODB. When you do more, eventually
things may take a little longer when you do less. This should be
obvious.

Anyway, if you really care about portability, you're only way out is
Metabase. Other abstraction packages were not meant for portability but
rather for interface makeup.

I think you will be the better judge of that if you try looking at least
at each package documentation. It is pointless to ask to people here
when most of them only know one or the other package.

Regards,
Manuel Lemos

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




Re: [PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-18 Thread Manuel Lemos

Hello,

Sp wrote:
> 
> Can someone with database expertise who has used metabase and adodb cut
> through this rhetoric and give an objective view of these two packages.
> From what I got from this convo is that metabase is slower but more portable
> but adodb is faster but not as portable.

No, Metabase does much more than ADODB. When you do more, eventually
things may take a little longer when you do less. This should be
obvious.

Anyway, if you really care about portability, you're only way out is
Metabase. If you are in doubt about the features, think at least about
what you can do with each package to migrate your data when you decide
to switch databases. Metabase is the only package that offer painless
and failure proof method of migrating data using the XML schema support.

With the other package you need to write custom scripts for migration
which is a real pain and prone to error due to eventual bugs of software
that you need to write on your own.

Other abstraction packages were not meant for true portability but
rather for interface makeup.

I think you will be the better judge of that if you try looking at least
at each package documentation. It is pointless to ask to people here
when most of them only know one or the other package.

You may also want to take a look at BinaryCloud which is a well designed
and mature PHP application development framework. It works with Metabase
and will save you countless hours of developing your applications from
scratch.

BinaryCloud
http://binarycloud.tigris.org/

Metabase
http://www.phpclasses.org/metabase

Regards,
Manuel Lemos

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




[PHP-DB] Re: Search Script

2002-04-25 Thread Manuel Lemos

Hello,

Jennifer Downey wrote:
> Hi all,
> 
> I have been trying to build a search script for my site that deals with only
> one table in my db.
> As Julie Meloni pointed out look in the MySQL manual for LIKE clauses I
> can't seem to locate that clause in ether
> manual.
> Dan Brunner gave me this to go on:
> 
> $query = "SELECT uid, id, image, iname, quantity, type FROM
> {$config["prefix"]}_shop WHERE  iname  LIKE = '%$shopsearch% ORDER BY
> iname'";
> $ret = mysql_query($query);
> while(list($quantity)=mysql_fetch_row($ret))
> 
> But I can't seem to get this to work. I have never worked with LIKE before
> and would appreciate any help on this.

Maybe you would like to see these classes that seem to do what you are 
looking for:

http://www.phpclasses.org/search%20query


Regards,
Manuel Lemos


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




Re: [PHP-DB] ODBC problem in 4.2.0

2002-04-30 Thread Manuel Lemos

Hello,

John Lim wrote:
> Hi Ryan,
> 
> It's not true that this can happen to any product. PHP is a fantastic
> language, but
> there are well-known ways to manage QA. All it needs is to include ODBC
> in the standard php regression test suite (and run the suite regularly!)

This is not the case of a bug but rather an intentional and documented 
backwards incompatible change of odbc_fecth_row function.

I think that is very unprofessional from the PHP developers that did it 
and approve it and it is not the first time they do it with this and 
other PHP function. Unfortunately there is an odd conception of them 
that if you break backwards compatibility and document it that is ok, 
which I completely disagree, especially because this was not a X.0 version.

Unlike with a real company, since there is no commercial harm for the 
PHP developers responsible for breaking backwards compatibility it is 
pointless to complain about lack of professionalism of the responsible 
PHP developers, as it was demonstrated in the episodes when they broke 
functions that worked consistently for 4 years like dirname and strtok.

The only way to solve people's problem with these functions is use PHP 
code that uses conditional programming based on the PHP version that is 
running.

Regards,
Manuel Lemos

> 
> Regards, John
> 
> "Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> BTW... I'd just like to point out that this kind of thing is bound to happen
> no matter what product you use. I'm certain the PHP guys will have this
> solved in no time and I'd bet even they would recommend a commercial hosting
> service be willing and able to step back if a problem like this occurs. This
> is, however, just an opinion.
> 
> -Original Message-
> From: Ryan Jameson (USA)
> Sent: Monday, April 29, 2002 8:14 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] ODBC problem in 4.2.0
> 
> 
> 
> I'd recommend finding a hosting service that would be more careful about
> making upgrades. There seems to be some problems with ODBC in 4.2 and I have
> yet to hear of a work around, especially not one you can implement if you
> don't handle your own server. I feel your pain man! Fortunately for me I can
> just stay at 4.1.1 until there's a release that works.
> 
> <>< Ryan
> 
> 
> -Original Message-
> From: Mihai Tache [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 29, 2002 7:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] ODBC problem in 4.2.0
> 
> 
> i work on a website that runs on php with MSSQL through ODBC.
> until 4.2.0 everything was ok. but my hosting provider just upgraded to
> 4.2.0
> the error message i get is :
> 
> SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with
> results for another hstmt, SQL state S1000 in SQLExecDirect in 
> 
> take the folowing code for example :
> 
>  $res=odbc_exec($conn,"select * from ...");
> for($i=1;odbc_fetch_row($res);$i++)
> {
> $res2=odbc_exec($conn,"select * from ");
> ...
> }
> ?>
> 
> the first odbc query runs OK but i get the error at the second one and ONLY
> if the first one returned more than one row.
> i even tried with 2 ODBC connections but doesn't work
> MS has something to say about this at
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032
> don't know if that is really the problem or not. i don't know how i can set
> ODBC (from php) to be synchronous anyway.
> the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6
> (both on win32).
> i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said
> is there something i can do except wait for 4.2.1 ?
> 
> 
> 
> 
> --
> 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] Re: php mail problem.

2002-05-07 Thread Manuel Lemos

Hello,

Darren Stock wrote:
> Hi, I cannot get the php mail function to work from a web browser, if I run
> my script from the linux prompt, containing the mail function, it runs fine,
> it sends the mail. But If I run it through my browser it doesn't come back
> with any errors, it just doesn't send the mail.
> my php.ini file is ok, as it sends the mail from the prompt. Is this a
> browser or webserver problem?
> I interrogated my mail server, and it doesn't even receive an email message.
> 
> im running apache with php on Mandrake 8.2

Most likely the Web user does not have an valid mailbox in the server 
machine. You need to set the envelop sender (AKA return-path) to some 
valid e-mail address mailbox. You need to either call sendmail directly 
with the -f switch or send the message to a SMTP server.

You may want to try these classes that do that for you:

http://www.phpclasses.org/browse.html/package/9.html

http://www.phpclasses.org/browse.html/package/14.html


-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: database absraction layer

2002-05-07 Thread Manuel Lemos

Adi wrote:
> dear all,
> 
> I'm writing  database abstraction layer class (like adoDB but much simpler). 
> What I want to do that it will provide single access function for different 
> type of database. Currently, it will only support mySQL and PostgreSQL.. but I 
> just don't know how to do this with better approach.

Usually you writer a driver class for each database that you want to 
support. Then you choose the appropriate class to access the database 
you want.

You may want to look at Metabase database abstraction package to learn 
how to do that:

http://www.phpclasses.org/browse.html/package/20.html

Regards,
Manuel Lemos



> 
> code snippet..
> 
> ..
> function connect(){
>   if($this->type == "mysql"){
>   $this->conid = 
>mysql_connect($this->host,$this->user,$this->pass);
>   }
>   elseif($this->type == "pgsql")){
>   $this->conid = pg_connect($this->host $this->port $this->db 
>$this->user 
> $this->pass); }
>   else { 
>   echo ("database type $this->type not supported");
>   }
>   }
> ..
> 
> any idea of doing such of function alias/wrapper?
> any help appreciated
> thanks
> 
> ___
> adi.aroundbali.com
> 



-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: xml doccument validation ?????

2002-05-20 Thread Manuel Lemos

Hello,

On 05/20/2002 04:05 PM, Toby z wrote:
> guyz 
> its terrable 
> i have a well formed xml doccument 
> but i cant get it validated ...
> i keep getting this error
> "this file is not valid. all fields referred to from
> the key identity constraint 'user_info_memb_id' 
> must exist"

What are you using to validate this document?

The expat based parser always tells you the line, the column and the 
byte index of the tag that is in error.

Looking at the XML code I can't see anything wrong in the document. 
Maybe it is a schema thing.

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: Simulating a FORM POST thing (HELP!)

2002-05-28 Thread Manuel Lemos

Hello,

On 05/26/2002 04:05 PM, Georgie Casey wrote:
> Rite, when you see a web form, you know you can simulate the submit by
> filling in the values in the address field, just like a GET method, and it
> usually works the exact same. But how do you do it when one of the fields in
> the form is a file upload?!?!?!
> 
> For the record, its a GIF file you've to upload. Is there any way to do this
> in PHP??

You may want to try this class that does precisely that.


http://www.phpclasses.org/httpclient

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Book about Metabase

2002-06-13 Thread Manuel Lemos

Hello,

Just thought you would like to know that a new book named PHP and XML 
was released with a whole chapter dedicated to Metabase. Despite the 
book is about XML, the Metabase chapter talks about its use of XML to 
describe schemas to be installed automatically by Metabase and also the 
database independent access to databases using Metabase API.

A review of the book will be published in the next weeks here not by me 
(I don't want you to think it would be biased) but by Alex Black of 
BinaryCloud fame.

http://www.phpclasses.org/products.html/id/0735712271.html

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: Excel to MySQL??

2002-06-29 Thread Manuel Lemos

Hello,

On 06/29/2002 06:21 PM, Chase wrote:
> Does anyone know of a way that I can export an Excel spreadsheet to a 
> file that I can import to MySQL?  I found a program that will do this 
> for Access, but I would rather leave Access out of this if possible.

I think you can do it via ODBC under Windows. Anyway, if you are running 
PHP under Windows, you may as well use COM objects to access to Excel 
spreadsheets. In that case you may want to try this class:

http://www.phpclasses.org/browse.html/package/86.html

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: Unified DB Query function

2002-07-01 Thread Manuel Lemos

Hello,

On 07/01/2002 06:46 AM, Casey Allen Shobe wrote:
> I'm trying to write a unified database query function for an application I 
> have which currently accesses data from both DB2 and Microsoft SQL from a 
> Linux server.  I'm using ODBC functions for DB2, and Sybase functions for 
> Microsoft SQL.

Why do you re-invent the wheeel and don't you use a database abstraction 
package that handles the database differences of you, like for instance 
Metabase:

http://www.phpclasses.org/metabase

-- 

Regards,
Manuel Lemos


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




Re: [PHP-DB] Re: Unified DB Query function

2002-07-01 Thread Manuel Lemos

Hello,

On 07/01/2002 03:01 PM, Pierre-Alain Joye wrote:
>>>I'm trying to write a unified database query function for an application I 
>>>have which currently accesses data from both DB2 and Microsoft SQL from a 
>>>Linux server.  I'm using ODBC functions for DB2, and Sybase functions for 
>>>Microsoft SQL.
>>
>>Why do you re-invent the wheeel and don't you use a database abstraction 
>>package that handles the database differences of you, like for instance 
>>Metabase:
>>
>>http://www.phpclasses.org/metabase
> 
> Just because diversity rules in our world :).
> 
> btw, do you have samples codes using the xDefinition methods in metabase ?

What do you mean by xDefinition methods?


-- 

Regards,
Manuel Lemos


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




Re: [PHP-DB] Re: Unified DB Query function

2002-07-01 Thread Manuel Lemos

Hello,

On 07/01/2002 05:03 PM, Casey Allen Shobe wrote:
> On Monday 01 July 2002 01:55 pm, Manuel Lemos wrote:
> 
>>Why do you re-invent the wheeel and don't you use a database abstraction
>>package that handles the database differences of you, like for instance
>>Metabase.
> 
> 
> Because I had never heard of it.  It doesn't appear to have a sybase module 

Now you heard of it.

There is a Sybase driver here awaiting to go through the driver 
conformance tests that verify if Metabase API features work as expected 
with this driver. You know, rigorous quality control so nobody gets 
surprises.

http://groups.yahoo.com/group/metabase-dev/files/beta/


> anyways, and they appear to be separate classes for each database, whereas I 

Actually separate classes for each database is a good idea because you 
only call each function fo one database at a time, so it is not bloated 
as it would be if there was a single class with code for all databases.


> wanted one for all.  Perhaps however I am misreading the site, but it won't 
> let me very far without a username and password.

You just need to subscribe to the site, it is free.

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: SQL mailing list

2002-07-09 Thread Manuel Lemos

Hello,

On 07/09/2002 05:22 PM, Casey Allen Shobe wrote:
> Do any of you know of any good, general SQL discussion mailing lists?
> 
> Preferably DB-independent.  I'd like to find a place to ask SQL questions and 
> get a human response...

This is a recorded message from a machine just to let you know that you 
may leave any SQL questions after the beep.

beep :-)

-- 

Regards,
Manuel Lemos


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




Re: [PHP-DB] Re: Unified DB Query function

2002-07-25 Thread Manuel Lemos

Hello,

On 07/25/2002 02:34 PM, Andrew Hill wrote:
> Pierre,
> 
> Why not use ODBC functions everywhere?

I already told you before. ODBC is very weak API for real database 
abstraction. To make it worse, PHP ODBC API is buggy and not as complete 
as it could be.

As the maintainer of PHP ODBC support, if you are willing to do anything 
about it, I can help you to pin point the problems that need to be 
addressed. Otherwise it is quite pointless to even consider using ODBC 
in PHP unless it is your really alternative.

Regards,
Manuel Lemos


> 
> Best regards,
> Andrew Hill
> Director of Technology Evangelism
> OpenLink Software  http://www.openlinksw.com
> Universal Data Access & Virtuoso Universal Server
> 
> 
> -Original Message-
> From: Pierre-Alain Joye [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 01, 2002 1:01 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Re: Unified DB Query function
> 
> On Mon, 01 Jul 2002 14:55:01 -0300
> Manuel Lemos <[EMAIL PROTECTED]> wrote:
> 
> 
>>Hello,
>>
>>On 07/01/2002 06:46 AM, Casey Allen Shobe wrote:
>>
>>>I'm trying to write a unified database query function for an
>>
> application I 
> 
>>>have which currently accesses data from both DB2 and Microsoft SQL
>>
> from a 
> 
>>>Linux server.  I'm using ODBC functions for DB2, and Sybase
>>
> functions for 
> 
>>>Microsoft SQL.
>>
>>Why do you re-invent the wheeel and don't you use a database
> 
> abstraction 
> 
>>package that handles the database differences of you, like for
> 
> instance 
> 
>>Metabase:
>>
>>http://www.phpclasses.org/metabase
> 
> Just because diversity rules in our world :).
> 
> btw, do you have samples codes using the xDefinition methods in
> metabase ?
> 
> 
> pa
> 


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




Re: [PHP-DB] MSSQL functions vs. ODBC functions

2002-07-25 Thread Manuel Lemos

Hello,

On 07/25/2002 02:34 PM, Andrew Hill wrote:
> Mark,
> 
> ODBC is not inherently slower - it depends if the driver is built as an
> abstraction to the native layer or if it bypasses the native layer.   In
> addition, a properly written ODBC driver will actually enforce
> additional functionality on the back-end database, to further isolate
> you from functional lacks.

The truth is that ODBC is insufficient and does not seem to be useful to 
completely isolate you from having to handle many database differences 
in your PHP database applications.



> Also, If you are going to migrate databases and have to change the
> database API calls in your script, do yourself a favor and use PEAR:DB
> with ODBC - less changes in the future.

This is another issue, but the truth is that PEAR:DB ODBC driver is very 
weak (read pratically useless for database independent development) 
precisely because ODBC API does not provide information or functions to 
deal with the underlying database in a independent manner.

Maybe you should try developing real database independent applications 
with it so you can have a real picture of how frustrating it can be.

Regards,
Manuel Lemos



> 
> Best regards,
> Andrew Hill
> Director of Technology Evangelism
> OpenLink Software  http://www.openlinksw.com
> Universal Data Access & Virtuoso Universal Server
> 
> -Original Message-
> From: Mark McCulligh [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, July 11, 2002 10:14 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] MSSQL functions vs. ODBC functions
> 
> I am not sure if this question has been asked before, If so sorry for
> asking
> again.
> 
> I have a site that the Client is moving from a MySQL db to Microsoft SQL
> Server.
> Is it better to setup an ODBC connection to SQL Server and use the ODBC
> functions OR to use the MSSQL functions.  If I have the choice with is
> better or are they about the same.  Logic would say ODBC is slower
> because
> it is another layer on top of the DB, but I don't know.
> 
> Mark.
> 
> _
> Mark McCulligh, Application Developer / Analyst
> Sykes Canada Corporation www.SykesCanada.com
> (888)225-6824 ex. 3262
> [EMAIL PROTECTED]
> 
> 
> 



-- 

Regards,
Manuel Lemos


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




Re: [PHP-DB] Re: Unified DB Query function

2002-07-31 Thread Manuel Lemos

Hello,

On 07/25/2002 04:35 PM, Andrew Hill wrote:
 > Manual,
 >
 > Certainly - please help us pinpoint any issues.
 >
 > Dan Kalowsky has done some great work in resolving lingering ODBC issues
 > in PHP, and I help in my way with testing and iODBC support.
 >
 > I respect the work you have done with Metabase, but it's a fallacy to
 > suggest that ODBC is "weak" - some ODBC drivers are indeed week, but a
 > proper driver provides more complete functionality than even native
 > drivers, and is often faster.

Andrew you ought to try developing really portable Web applications with 
PHP using ODBC so you can understand better what I am talking.

The real problem is that ODBC was not meant for addressing specifically 
the actual needs of Web development.

The ODBC driver was the most frustrating driver that I developed for 
Metabase. The problem is that ODBC API does not expose enough 
information from the underlying database so Metabase could figure how to 
implement some abstracted features.

For instance, Metabase abstracts sequences. If the underlying database 
supports auto_increment fields, Metabase creates a separate table with a 
single auto_increment field to emulate a sequence. So far, so good. But 
how do I retrieve the last inserted number in a database independent 
way? Is it possible at all with ODBC API? Even if it is possible, I 
can't see support for the in ODBC API PHP functions.

Another issue is selecting specific ranges of result rows. Doing this 
efficiently depends a lot on the underlying database. In MySQL we use 
LIMIT. On MS-SQL I use server side cursors. Other database have special 
keywords that prevent hogging the server or the database connecting 
sending unnecessary query result data.

I know ODBC has several cursor models. Client side cursors are what 
Metabase ODBC uses already, but that is not as efficient as using 
specific database keywords. Even if I can use a server side cursor, how 
can I know with the current ODBC API PHP functions tell if the ODBC 
driver is capable of using such cursors? There doesn't seem to be a way 
to do it.

Another thing are transactions. How do I tell if the underlying ODBC 
driver supports transactions? I know you can know it in C calling the 
ODBC API but there is no support to tell that from PHP.

A major flop of ODBC PHP API are NULLs. How do I tell if a result set 
column has a NULL? It returns an empty string. How do I distinguish 
result set column empty string values from real NULLs? This needs to be 
fixed.

Other than that, there were problems with odbc_gettypeinfo() more than 
once in the same script. Depending when you would free the result set it 
was either crashing PHP or returning an empty result set. I don't know 
if this was fixed since PHP 4.0.6 but the problem existed and prevented 
Metabase ODBC driver to figure how to correctly create tables and using 
correctly certain types of fields like blobs.

There are probably other types of problems, but these are those that I 
remember immediately.

Anyway, so far, it seems that using ODBC with PHP is pretty useless 
especially to write portable database independent applications until 
these problems are addressed. Because of this I will need to develop 
ODBC sub-drivers for Metabase that are aware of database specific 
details that PHP ODBC support is uncapable of providing.

Regards,
Manuel Lemos


 > -Original Message-
 > From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
 > Sent: Thursday, July 25, 2002 1:39 PM
 > To: [EMAIL PROTECTED]
 > Subject: Re: [PHP-DB] Re: Unified DB Query function
 >
 > Hello,
 >
 > On 07/25/2002 02:34 PM, Andrew Hill wrote:
 >
 >>Pierre,
 >>
 >>Why not use ODBC functions everywhere?
 >
 >
 > I already told you before. ODBC is very weak API for real database
 > abstraction. To make it worse, PHP ODBC API is buggy and not as complete
 >
 > as it could be.
 >
 > As the maintainer of PHP ODBC support, if you are willing to do anything
 >
 > about it, I can help you to pin point the problems that need to be
 > addressed. Otherwise it is quite pointless to even consider using ODBC
 > in PHP unless it is your really alternative.
 >
 > Regards,
 > Manuel Lemos
 >
 >
 >
 >>Best regards,
 >>Andrew Hill
 >>Director of Technology Evangelism
 >>OpenLink Software  http://www.openlinksw.com
 >>Universal Data Access & Virtuoso Universal Server
 >>
 >>
 >>-Original Message-
 >>From: Pierre-Alain Joye [mailto:[EMAIL PROTECTED]]
 >>Sent: Monday, July 01, 2002 1:01 PM
 >>To: [EMAIL PROTECTED]
 >>Cc: [EMAIL PROTECTED]
 >>Subject: Re: [PHP-DB] Re: Unified DB Query function
 >>
 >>On Mon, 01 Jul 2002 14:55:01 -0300
 >>Manuel Lemos <[EMAIL PROTECTED]> wrote:
 >>
 >>
 >>
 >

Re: [PHP-DB] Mail problem

2002-08-01 Thread Manuel Lemos

Hello,

On 12/31/1969 09:00 PM, Unknown Sender wrote:
> Of course, but
> 
> PHP is on Linux machine where I don't have sendmail, because my 
> mail server is on different machine, and that's my problem

If you are allowed, you can install sendmail in your machine and 
configure to route all mail through the mail server.

If you can't, all you can do is to use some PHP SMTP client code to send 
your messages.

In this case you may want to try this class that is optimized for 
queuing messages for many recipients as you need.

http://www.phpclasses.org/smtpclass

You are strongly recommended to put all recipients in Bcc: because 
queuing via SMTP is much slower than using a local mailer like sendmail 
and it would take you a long time to queue if you send separate messages 
for each recipient.

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: Database abstraction layer needed?

2002-08-17 Thread Manuel Lemos

Hello,

On 08/17/2002 04:28 PM, Leif K-Brooks wrote:
> I'm redoing my web site, and I'm considering using a db abstraction 
> layer.  Would I need one, and should it be db-type specific (like, can 
> just do one db type)?  I don't plan to change database types.

If you don't plan to change database types, a database independent 
abstraction layer is probably not very interesting.

So what do you want the abstraction layer to abstract?


-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: htdig interface class

2002-08-28 Thread Manuel Lemos

Hello,

On 08/28/2002 06:35 AM, Olinux wrote:
> http://phpclasses.promoxy.com/browse.html/package/26.html
> 
> Anyone tried this package - successfully?
> I have only been able to pull up "No results".
> 
> I spent the past 10 hours trying to find/write a
> wrapper for htdig that will call htsearch mutliple
> times with different options (specifically
> limit_urls_to and restrict) to emulate results in
> categories. If anyone could point me to potential
> hangups - I would sure appreciate it.

Have you setup the configuration right first? Have you run the page 
indexing script?

If you need further help, just let me know because I wrote that class.


-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: convert mysql table to Excell or Access file

2002-08-28 Thread Manuel Lemos

Hello,

On 07/12/2002 07:36 PM, Alex Shi wrote:
> Can MySQL table be converted to Access or Excell format?
> 
> Alex
> 

You may want to try this class that can write Excell files just with 
PHP, so it can run under Linux/Unix too:

http://www.phpclasses.org/biffwriter

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: MIME encoding and simplified chinese....help!

2002-10-14 Thread Manuel Lemos

Hello,

On 10/14/2002 09:34 PM, Nigel Dunn wrote:
> I have a PHP MIME class that works supurblymy big question is...
> 
> Is there a way to convert the subject line to simplified chinese. The 
> body of the email is fine but I havent been able to get the subject line 
> to display chinese.

I don't know what class are you using, but if it is this class, all you 
need to do is to specify the chinese encoding that you want to use in 
the optional charset argument of the SetHeader function.


-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: MIME encoding and simplified chinese....help!

2002-10-14 Thread Manuel Lemos

Hello,

> On 10/14/2002 09:34 PM, Nigel Dunn wrote:
> 
>> I have a PHP MIME class that works supurblymy big question is...
>>
>> Is there a way to convert the subject line to simplified chinese. The 
>> body of the email is fine but I havent been able to get the subject 
>> line to display chinese.
> 
> 
> I don't know what class are you using, but if it is this class, all you 
> need to do is to specify the chinese encoding that you want to use in 
> the optional charset argument of the SetHeader function.

I meant this class:

http://www.phpclasses.org/mimemessage

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Re: TOO MANY CONNECTIONS!!

2002-10-23 Thread Manuel Lemos
Hello,

On 10/23/2002 06:18 PM, Georgie Casey wrote:

Im getting a too many connections error in my PHP pages at
http://www.free-ringtones.tv. I presume this is from the MySQL server, and I
know I access the database a lot for each page. So whats the solution to
this?? Write scripts that create static html pages that update every 20
minutes or so??

And was it the host that limited my connections???


You probably reached the number of persistent connections configured in 
php.ini . If you allow a larger number you probably exhaust your server 
memory until it crashes.

The best solution is to cache content taken from the database and that 
does not vary frequently. That will also make your site faster. In that 
case you may want to try this class that can be used to store arbitrary 
data in files, like the HTML excerpts that are generated from your 
database queries.

http://www.phpclasses.org/filecacheclass


--

Regards,
Manuel Lemos


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



[PHP-DB] Re: Automattic Rollback on User Cancel with MySQL

2002-10-18 Thread Manuel Lemos
Hello,

On 10/18/2002 08:47 AM, Benjamin Schleinzer wrote:

Hi

I Am using the latest PHP version 4.2.3 with MySQL 3.23.51-max. I use 
InnoDB tables for transactions and everything works fine with Rollback 
and Commit. But when the user presses cancel in the browser or the 
script stops due to an error in the script all open transactions are 
committed instead of rolled back. Is there some way to change this 
behavior ?

If you use Metabase, it will automatically rollback uncommitted 
transactions at the script exit even when the script ends due to user 
abort or some other error.

http://www.phpclasses.org/metabase


--

Regards,
Manuel Lemos


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



[PHP-DB] Re: String extraction from blobs. Extracted string to be placedinto field within another table.

2002-10-20 Thread Manuel Lemos
Hello,

On 10/19/2002 11:13 PM, Dwalker wrote:

What is the most effective method of extracting from a blob specified 
text to be placed into another table field.

If you use Metabase it allows you to create prepared queries where you 
can pipe data from blob returned by a select query to a blob to be 
updated or inserted by another query, with minimal memory usage, thus 
allowing to manipulate large sized blobs.

Metabase is a database independent abstraction layer so it works with 
many supported databases:

http://www.phpclasses.org/metabase

--

Regards,
Manuel Lemos


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



[PHP-DB] Re: Performance problems?

2002-11-01 Thread Manuel Lemos
Hello,

On 11/02/2002 03:21 AM, Leif K-Brooks wrote:

I've been optimizing scripts in an attempt to speed my friend's site up, 
and I believe I've found the source of the performance problems.  When I 
comment the following page load time changes from around 6 seconds to 
less than .5 of a second.

   if($loggedin){
   $events = mysql_query("select * from events where 
whofor='{$userinfo['id']}' order by id desc limit 1");
   if(mysql_num_rows($events) == 1){
   $events = mysql_fetch_array($events);
   print <<< END
   {$events['message']} 

   END;
   }
   }

This code checks for events (new mail, etc.) that the user may have and 
dispays them.  Any idea on what makes it perform this badly?

The order by clause is the killer. It forces the server to rebuild the 
whole table in memory just to returned the results sorted. If you just 
want the highest id, use MAX(id) .


--

Regards,
Manuel Lemos


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



Re: [PHP-DB] Re: Performance problems?

2002-11-02 Thread Manuel Lemos
Hello,

On 11/02/2002 04:04 AM, Leif K-Brooks wrote:

Aha - thanks.  The problem is, I also need to retrieve other data 
asscociated with it.  I'll alter the table to order by id, but is there 
anything long-term I can do?

What I meant is that if you make two queries, one to fetch max(id) and 
another to fetch just the row with the resulting id from the first 
query, you will most likely run that faster than the query with order by 
that you did.

Using order by in result sets with a large number of rows is considered 
to be a SQL sin. :-)


--

Regards,
Manuel Lemos


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



[PHP-DB] Re: Abstraction layer or not?

2002-11-05 Thread Manuel Lemos
Hello,

On 11/05/2002 11:21 PM, Leif K-Brooks wrote:

I'm working on a new site, and I'm wondering whether to use an 
abstraction layer or not.  I don't have any plans to switch DB system, 
but you never know what the future holds.  I figure that there's no 
reason not to, but are there any down sides?  Which abstraction layers 
are good?

There is another point on using abstraction layers which is the fact 
that since many people use the same API, all can share the eventual 
tools and components based on that API.

For instance, I am developing a data persistence layer generator that is 
able to generate code and database schemas from a description in XML of 
the structure of a set of classes and the relationships that exist 
between them.

The generator creates the modelled classes and a database schema to 
provide persistent storage for the classes objects. The classes provide 
an API to retrieve and store the objects according to your application 
as described in the model description in XML. See below for a simple 
example.

With this tool you no longer need to put up with the tedious work of 
setting databases, write SQL by hand, write code to retrieve and store 
the data, etc.. This way you can speedup the development of your 
application often by more than an order of magnitude.

The generated code and database schema description (also in XML) is 
based on Metabase database abstraction, so anybody using Metabase can 
benefit from this tool.

Read more about this here:

http://www.meta-language.net/news-2002-11-01-persistence.html

http://www.phpclasses.org/metabase

--

Regards,
Manuel Lemos



(#) $Id: cms.component,v 1.3 2002/11/06 01:52:52 mlemos Exp $
  -->

	cms
	Content management system component

	
		article

		
			title
			text
		

		
			lead
			text
		

		
			body
			text
		

		
			author
			author
		

		
			creation_date
			timestamp
		

		
			categories
			category
			articles
		

	

	
		author

		
			name
			text
		

		
			articles
			article
			author
		

	

	
		category

		
			name
			text
		

		
			description
			text
		

		
			parent
			category
		

		
			children
			category
			parent
		

		
			articles
			article
			categories
		

	

	

		
			installschema
			installschema
		

	

	

		
			getarticle
			getobject
			
article

	article

			
		

		
			getauthor
			getobject
			
author

	author

			
		

		
			getcategory
			getobject
			
category

	category

			
		

	




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



[PHP-DB] ANNOUNCE: Metastorage object persistence API generator

2002-12-05 Thread Manuel Lemos
Hello,

Finally I made time to release a full blown application based on MetaL 
compiler persistence module.

Here is the release announcement that may also be found on the site:

http://www.meta-language.net/news-2002-12-05-metastorage.html

  _

Released Metastorage generator
Manuel Lemos, 2002-12-05 16:11:44 GMT

Metastorage is an application that is capable of generating
persistence layer APIs. It takes a component definition defined in the
Component Persistence Markup Language (CPML), a XML based format, and
generates classes and storage schemas in a given target programming
language.

Using CPML, developers can focus their efforts on the modeling of data
structures that hold the information and the relationships between the
entities that their applications deal with. Metastorage takes care of
generating all the necessary code to store and retrieve such data
structures from persistent storage containers like relational
databases.

The main goal of Metastorage is to drastically reduce the time to
develop applications that traditionally use on SQL based relational
databases.

The generated APIs consist of a sets of classes that provide an Object
Oriented interface to the objects of the classes modeled using CPML.

The generated APIs are also capable of installing the data schema in
the persistence container, which in the case of a relational database
is the set of tables that will hold the persistent objects. This
completely eliminates the need to write any SQL queries manually.
CPML is independent of the type of persistent container. This means
that while it can be used to model classes of persistent objects that
may be stored in relational databases, such objects may as well be
stored in other types of persistence containers.

For instance, if an application needs to move a directory of objects
with user information from a relational database to a LDAP server to
increase the application scalability, the same CPML component
definition would be used. Metastorage would then generate classes
objects that implement the same API for interfacing with a LDAP server
that is compatible with the API generated to interface with relational
databases. This make the migration process easier and with reduced
risks.

Another possible benefit of the persistence container independence of
the APIs generated by Metastorage, is the case where an application
may need to run in environments where a SQL based database server is
not available. In that case the same API could be generated to store
persistent objects in flat file databases or plain XML files.

For now, the current version of Metastorage only supports the
generation of PHP code based on the database independent Metabase API.
This means that it may also interface with PEAR::MDB database
abstraction layer using its built-in Metabase API wrapper. In
consequence, many types of relational databases are already supported.

Since this is the first release of Metastorage, there is plenty of
room for improvement in the possibilities of the generated persistence
APIs and the level of optimization of the generated code. In the
future it will be supported other languages besides PHP, other
database APIs besides Metabase and other persistence containers
besides relational databases.

Metastorage is based on MetaL compiler persistence module. Like MetaL,
Metastorage is Open Source and is distributed with BSD like software
license. Downloadable archives and documentation with an example of
component definition are available from the MetaL site.


--

Regards,
Manuel Lemos


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



[PHP-DB] ANNOUNCE: Metastorage object persistence API generator

2002-12-05 Thread Manuel Lemos
Hello,

Finally I made time to release a full blown application based on MetaL
compiler persistence module.

Here is the release announcement that may also be found on the site:

http://www.meta-language.net/news-2002-12-05-metastorage.html

   _

Released Metastorage generator
Manuel Lemos, 2002-12-05 16:11:44 GMT

Metastorage is an application that is capable of generating
persistence layer APIs. It takes a component definition defined in the
Component Persistence Markup Language (CPML), a XML based format, and
generates classes and storage schemas in a given target programming
language.

Using CPML, developers can focus their efforts on the modeling of data
structures that hold the information and the relationships between the
entities that their applications deal with. Metastorage takes care of
generating all the necessary code to store and retrieve such data
structures from persistent storage containers like relational
databases.

The main goal of Metastorage is to drastically reduce the time to
develop applications that traditionally use on SQL based relational
databases.

The generated APIs consist of a sets of classes that provide an Object
Oriented interface to the objects of the classes modeled using CPML.

The generated APIs are also capable of installing the data schema in
the persistence container, which in the case of a relational database
is the set of tables that will hold the persistent objects. This
completely eliminates the need to write any SQL queries manually.
CPML is independent of the type of persistent container. This means
that while it can be used to model classes of persistent objects that
may be stored in relational databases, such objects may as well be
stored in other types of persistence containers.

For instance, if an application needs to move a directory of objects
with user information from a relational database to a LDAP server to
increase the application scalability, the same CPML component
definition would be used. Metastorage would then generate classes
objects that implement the same API for interfacing with a LDAP server
that is compatible with the API generated to interface with relational
databases. This make the migration process easier and with reduced
risks.

Another possible benefit of the persistence container independence of
the APIs generated by Metastorage, is the case where an application
may need to run in environments where a SQL based database server is
not available. In that case the same API could be generated to store
persistent objects in flat file databases or plain XML files.

For now, the current version of Metastorage only supports the
generation of PHP code based on the database independent Metabase API.
This means that it may also interface with PEAR::MDB database
abstraction layer using its built-in Metabase API wrapper. In
consequence, many types of relational databases are already supported.

Since this is the first release of Metastorage, there is plenty of
room for improvement in the possibilities of the generated persistence
APIs and the level of optimization of the generated code. In the
future it will be supported other languages besides PHP, other
database APIs besides Metabase and other persistence containers
besides relational databases.

Metastorage is based on MetaL compiler persistence module. Like MetaL,
Metastorage is Open Source and is distributed with BSD like software
license. Downloadable archives and documentation with an example of
component definition are available from the MetaL site.


--

Regards,
Manuel Lemos


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




Re: [PHP-DB] Validating forms

2001-04-02 Thread Manuel Lemos

Hello,

"Julio Cuz, Jr." wrote:
> 
> Hi--
> 
> I have a form that cannot have a specific field blank, so I would like to
> add a message box saying "fill out the x field," is there a way to do this
> WITHOUT having to refresh the page?

Maybe you would like to try this PHP form generation and validation
class that does precisely what you want and more:

http://phpclasses.UpperDesign.com/browse.html/package/1

Manuel Lemos

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




Re: [PHP-DB] Forms : Validating user input is integer

2001-04-07 Thread Manuel Lemos

Hello boclair,

On 05-Apr-01 01:58:24, you wrote:

>I have a problem with a user input in a form required to be an
>integer, creating a variable for a mysql query.

>I have instances where integer, 0, is being typed as letter,o.

>The last discussion of validating the input was
>http://marc.theaimsgroup.com/?l=php-db&m=97207172003983&w=2

>There it was suggested that the only way to validate the input was
>using javascript.  I have a case where clients have disabled
>javascript.

>I tried fiddling with is_int($input) but of cause it does not serve
>this purpose.

>Does anybody know if such validation can be done server side or
>definitely must be done client side?

You may want to try this PHP form generation and validation class that does
exactly what you need and more.

http://phpclasses.UpperDesign.com/browse.html/package/1


It does both client and server side validation.  For the client side it
uses the isNaN(parseInt(value)) Javascript functions.  For the server side
it uses the strcmp($value,strval(intval($value))) PHP functions .


Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


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




Re: [PHP-DB] using LIMIT

2001-04-07 Thread Manuel Lemos

Hello Sharmad,

On 06-Apr-01 08:33:54, you wrote:

>Hi,
>   Thanks for firstly helping me out with the prevoius query.
>   I have a database with mem_id(int) and name(text) as its fields.
>   In the first form (HTML) ,I take mem_id,name and count(used for LIMIT)
>   from the browser.

>   In the second query i write a query whereby i say
>$result=pg_Exec($database,"SELECT mem_id,name from search LIMIT $count");
>   Now here i display the the first 10(say $count=10) records.
>   Now I know to display the other records i can say   
>$result=pg_Exec($database,"SELECT mem_id,name from search LIMIT
>$count,$count");
>   but what condition to give to display pages of more than $count records
>   i.e how do i give for next  existing page.

What you need to do is to pass to the LIMIT clause the $first and $limit
values where the $first is the number of the page of results you want to
display times the number records you want to see per page which is also the
$limit.

Maybe you want to look at Metabase which is a PHP database abstraction page
that lets you specify the range of rows that you want to retrieve pretty
much like the LIMIT clause, except that it works well in all supported
databases including PostgreSQL versions that did not support the LIMIT
clause.

http://phpclasses.UpperDesign.com/browse.html/package/20

With Metabase you may use this other PHP query result table display class
that is able to display query result rows in HTML tables with optional
links to go to the next, previous, first, last, etc...  result pages.  It
uses MetabaseSetSelectedRowRange($database,$first,$limit) function to
choose the rows that it displays in each page.


Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


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




Re: [PHP-DB] Oracle session cursor

2001-04-16 Thread Manuel Lemos

Hello Doug,

On 16-Apr-01 01:29:30, you wrote:


>As you all know, PHP is stateless. Meaning that once the script ends, all
>connections are closed and the program is done.

>I have a project where I need to do just 1 query to oracle, but only get one
>row per page. So on the first page it does the query and says "20 results
>total" and shows the first selected row. Then I click next and it brings up
>the second row. I'm only supposed to show one row at a time. I can probably
>cheat and parse the query on each page, but I'd like to find out from you
>nice folks if its possible to do it with just one query. My guess is that I
>would be using a persistant OCI connection and an oracle package/procedure,
>but I'm not familiar with either of those enough to know if its possible or
>not. Or maybe I could store my parsed query in a PHP4 session? Thats another
>thing I am not very familiar with at this time.

You may want to try Metabase.  It is a database abstraction package that
has a feature that makes all database work like as if all supported
databases, including Oracle with OCI, had the LIMIT clause like MySQL.

The way it works is just by calling before executing a query:

MetabaseSetSelectedRowRange($database,$first,$limit)

where $database is a previously set up Metabase $database handle, $first
is the first row you want to fetch and $limit is the number of rows you
want to fetch for this query. In your case $limit should be one.

You may download Metabase for free with documentation and a tutorial from
here:

http://phpclasses.UpperDesign.com/browse.html/package/20

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


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




  1   2   3   >