Re: [PHP] database hell

2012-07-16 Thread Ressy
On 15/07/2012 17:07, Nick Edwards wrote: > On 7/12/12, Ashley Sheridan wrote: > >> "ma...@behnke.biz [5]" wrote: >> >>> Nick Edwards hat am 12. Juli 2012 um 14:00 geschrieben: >>> On 7/12/12, Gibbs wrote: > mysql_query("DELETE from userprefs where clientr='$User'", >>>

Re: [PHP] database hell

2012-07-15 Thread Nick Edwards
On 7/12/12, Ashley Sheridan wrote: > > > "ma...@behnke.biz" wrote: > >> >> >> >>Nick Edwards hat am 12. Juli 2012 um 14:00 >>geschrieben: >> >>> On 7/12/12, Gibbs wrote: >>> >>> > mysql_query("DELETE from userprefs where clientr='$User'", >>$connmy); >> >> >>Sidenote: And don't forget to valida

Re: [PHP] database hell

2012-07-12 Thread Ashley Sheridan
"ma...@behnke.biz" wrote: > > > >Nick Edwards hat am 12. Juli 2012 um 14:00 >geschrieben: > >> On 7/12/12, Gibbs wrote: >> >> > mysql_query("DELETE from userprefs where clientr='$User'", >$connmy); > > >Sidenote: And don't forget to validate user input and make use of mysql >escape >and prepa

Re: [PHP] database hell

2012-07-12 Thread ma...@behnke.biz
Nick Edwards hat am 12. Juli 2012 um 14:00 geschrieben: > On 7/12/12, Gibbs wrote: > > > mysql_query("DELETE from userprefs where clientr='$User'", $connmy); Sidenote: And don't forget to validate user input and make use of mysql escape and prepared statements ;) -- PHP General Mailing L

Re: [PHP] database hell

2012-07-12 Thread Nick Edwards
On 7/12/12, Gibbs wrote: >>> $connmy=mysql_connect("host","user","pass", TRUE); >>> >>> http://php.net/manual/en/function.mysql-connect.php >>> >> >> Thanks, will give that a shot >> > I forgot to add your queries will need the new link too. So > > mysql_query("DELETE from userprefs where clientr

Re: [PHP] database hell

2012-07-12 Thread Nick Edwards
On 7/12/12, Adam Nicholls wrote: > > >> -Original Message- >> From: Nick Edwards [mailto:nick.z.edwa...@gmail.com] >> Sent: 12 July 2012 12:30 >> To: php-general@lists.php.net >> Subject: [PHP] database hell >> >> Hi >> >> We have a program that manages users, throughout all database calls

Re: [PHP] database hell

2012-07-12 Thread Gibbs
On 12/07/12 12:38, Nick Edwards wrote: On 7/12/12, Gibbs wrote: On 12/07/12 12:29, Nick Edwards wrote: Hi We have a program that manages users, throughout all database calls created as: $connect = mysql_connect($db_host--other variables); mysql_query("Delete from clients where id=$User"); A

RE: [PHP] database hell

2012-07-12 Thread Adam Nicholls
> -Original Message- > From: Nick Edwards [mailto:nick.z.edwa...@gmail.com] > Sent: 12 July 2012 12:30 > To: php-general@lists.php.net > Subject: [PHP] database hell > > Hi > > We have a program that manages users, throughout all database calls > > created as: > $connect = mysql_connec

Re: [PHP] database hell

2012-07-12 Thread Stuart Dallas
On 12 Jul 2012, at 12:29, Nick Edwards wrote: > We have a program that manages users, throughout all database calls > > created as: > $connect = mysql_connect($db_host--other variables); > mysql_query("Delete from clients where id=$User"); > > All this works good, but, we need, in the delete fun

Re: [PHP] database hell

2012-07-12 Thread Nick Edwards
On 7/12/12, Gibbs wrote: > On 12/07/12 12:29, Nick Edwards wrote: >> Hi >> >> We have a program that manages users, throughout all database calls >> >> created as: >> $connect = mysql_connect($db_host--other variables); >> mysql_query("Delete from clients where id=$User"); >> >> All this works goo

Re: [PHP] database hell

2012-07-12 Thread Gibbs
On 12/07/12 12:29, Nick Edwards wrote: Hi We have a program that manages users, throughout all database calls created as: $connect = mysql_connect($db_host--other variables); mysql_query("Delete from clients where id=$User"); All this works good, but, we need, in the delete function to delete

Re: [PHP] database design in a survey/poll system

2010-11-17 Thread Tamara Temple
On Nov 17, 2010, at 7:42 AM, 肖晗 wrote: I plan to design a small survey/poll system similar to polldaddy . And I have some confusion in designing the database for the multiple/ single choice questions. Of course, it is possible to use one table to store the question tit

Re: [PHP] database design in a survey/poll system

2010-11-17 Thread Adam Richardson
On Wed, Nov 17, 2010 at 8:42 AM, 肖晗 wrote: > I plan to design a small survey/poll system similar to > polldaddy > . > > And I have some confusion in designing the database for the multiple/single > choice questions. Of course, it is possible to use one table to store the >

Re: [PHP] Database Administration

2010-09-30 Thread Tom Barrett
Thanks for the replies, they have been most enlightening. :)

Re: [PHP] Database Administration

2010-09-24 Thread Bastien Koert
On Fri, Sep 24, 2010 at 3:50 PM, Bob McConnell wrote: > From: tedd > >>At 2:36 PM -0400 9/24/10, Bastien Koert wrote: >>>On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote:  At 2:09 PM -0400 9/24/10, Bastien Koert wrote: > > �...@tedd, > >  He wants not techie users to create new sy

RE: [PHP] Database Administration

2010-09-24 Thread Bob McConnell
From: tedd >At 2:36 PM -0400 9/24/10, Bastien Koert wrote: >>On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote: >>> At 2:09 PM -0400 9/24/10, Bastien Koert wrote: @tedd, He wants not techie users to create new systems for their clients when they sign up. It involves creatin

Re: [PHP] Database Administration

2010-09-24 Thread tedd
At 2:36 PM -0400 9/24/10, Bastien Koert wrote: On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote: At 2:09 PM -0400 9/24/10, Bastien Koert wrote: @tedd, He wants not techie users to create new systems for their clients when they sign up. It involves creating a DB and he's wondering about secur

Re: [PHP] Database Administration

2010-09-24 Thread Bastien Koert
On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote: > At 2:09 PM -0400 9/24/10, Bastien Koert wrote: >> >> @tedd, >> >> He wants not techie users to create new systems for their clients when >> they sign up. It involves creating a DB and he's wondering about >> security for that. The main part of the app

Re: [PHP] Database Administration

2010-09-24 Thread tedd
At 2:09 PM -0400 9/24/10, Bastien Koert wrote: @tedd, He wants not techie users to create new systems for their clients when they sign up. It involves creating a DB and he's wondering about security for that. The main part of the app needs the least priv's to run (select, update, insert [,delet

Re: [PHP] Database Administration

2010-09-24 Thread Bastien Koert
On Fri, Sep 24, 2010 at 2:05 PM, tedd wrote: > At 11:19 AM +0100 9/24/10, Tom Barrett wrote: >> >> On 22 September 2010 21:40, Bastien Koert wrote: >> >>>  Not at all. What I would suggest is that you create a separate mysql >>>  user that is used exclusively by the script to do the create stuff.

Re: [PHP] Database Administration

2010-09-24 Thread tedd
At 11:19 AM +0100 9/24/10, Tom Barrett wrote: On 22 September 2010 21:40, Bastien Koert wrote: Not at all. What I would suggest is that you create a separate mysql user that is used exclusively by the script to do the create stuff. The regular application user account should not have those

Re: [PHP] Database Administration

2010-09-24 Thread Andrew Ballard
On Fri, Sep 24, 2010 at 6:19 AM, Tom Barrett wrote: [snip] > I'm not actually that familiar with DB admin to that extent. I have either > app users with lock+crud on specific databases, or root. As a an aside, > would you know if there is a level of permissions for a user between app and > root th

Re: [PHP] Database Administration

2010-09-24 Thread Tom Barrett
On 22 September 2010 21:40, Bastien Koert wrote: > Not at all. What I would suggest is that you create a separate mysql > user that is used exclusively by the script to do the create stuff. > The regular application user account should not have those privileges > at all. > I'm not actually that

Re: [PHP] Database Administration

2010-09-23 Thread tedd
At 9:35 PM +0100 9/22/10, Tom Barrett wrote: Hmm.. I am familiar with PMA. I would for the purpose of this project consider it too technical for the target user base. The point is to create a GUI layer that would manage these things. For example, the 'add client' screen would ask for four thing

Re: [PHP] Database Administration

2010-09-22 Thread Bastien Koert
On Wed, Sep 22, 2010 at 4:35 PM, Tom Barrett wrote: > Hmm.. > > I am familiar with PMA. I would for the purpose of this project consider it > too technical for the target user base. The point is to create a GUI layer > that would manage these things. > > For example, the 'add client' screen would

Re: [PHP] Database Administration

2010-09-22 Thread Tom Barrett
Hmm.. I am familiar with PMA. I would for the purpose of this project consider it too technical for the target user base. The point is to create a GUI layer that would manage these things. For example, the 'add client' screen would ask for four things; name, description, username and password. Th

Re: [PHP] Database Administration

2010-09-21 Thread tedd
At 10:48 AM +0100 9/21/10, Tom Barrett wrote: Hi I need to build a custom client management app, which will build and manage a database per client. This means that on top of the usual sql crud, it needs to be able to create databases, add/edit/delete database users, create tables. Is there a wa

RE: [PHP] Database Administration

2010-09-21 Thread Jay Blanchard
[snip] I need to build a custom client management app, which will build and manage a database per client. This means that on top of the usual sql crud, it needs to be able to create databases, add/edit/delete database users, create tables. Is there a way for me to do this nicely as PHP solution?

RE: [PHP] Database Administration

2010-09-21 Thread Jangita
Possible. Google phpmyadmin I believe it is completely written in PHP and does complete database administration (has some weaknesses on stored procedures though in my view) Jangita | +254 76 918383 | MSN & Y!: jang...@yahoo.com Skype: jangita | GTalk: jangita.nyag...@gmail.com -Original Mes

Re: [PHP] Database Administration

2010-09-21 Thread Peter Lind
On 21 September 2010 11:48, Tom Barrett wrote: > Hi > > I need to build a custom client management app, which will build and manage > a database per client. This means that on top of the usual sql crud, it > needs to be able to create databases, add/edit/delete database users, create > tables. > >

[PHP] Re: PHP database interface layer

2010-07-22 Thread Shawn McKenzie
On 07/22/2010 08:35 AM, Marc Guay wrote: > Hi everyone, > > I've built a fairly large normalized database schema for a project. > This is fun for me as I like thinking about how everything is > interconnected. Foreign keys are all set up, many-to-many tables are > go, etc, and so on. But now it

Re: [PHP] Database vs. Array

2010-03-16 Thread Ryan Sun
Maybe you want to optimize your script first, and I don't think read entire data set into array would save you much time. Don't create new variables when its unnecessary, cache data when its necessary, try memcached, and I think heavy php cli scripts are always likely to resume a lot of resource

Re: [PHP] Database vs. Array

2010-03-16 Thread Bastien Koert
What I usually do is to pull a limited set of records ( like 10 or 50 ) and the do the operations on them, update a column in that table to mark them completed and use JavaScript to reload the page and pull the next set out where that flag field is null. No memory issue, no need to large timeouts

Re: [PHP] Database design

2010-02-24 Thread Paul M Foster
On Thu, Feb 25, 2010 at 03:37:38PM +1000, Angus Mann wrote: > Hi all. I know this is not strictly a PHP question but the code will be > written in PHP, and I figure the folks here will be well versed in the > questions I raise. Please feel free to contact me off the list if appropriate. > > I n

Re: [PHP] database abstraction layer

2010-02-03 Thread Lester Caine
Ashley Sheridan wrote: On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote: function getMax($table, $field) If I saw this sort of code I'd be appalled! It's possibly the worst way to get the auto increment value. You won't notice it testing the site out on your own, but all hell will break

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Wed, Feb 03, 2010 at 06:39:29AM +0100, Rene Veerman wrote: > On Wed, Feb 3, 2010 at 5:49 AM, Jochem Maas wrote: > > you can bet you ass that every other DB out there that's worth it's salt > > has atomic id incrementor functionality exposed in some way or other. > > > > @Rene: all that talk of

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
On Wed, Feb 3, 2010 at 5:49 AM, Jochem Maas wrote: > you can bet you ass that every other DB out there that's worth it's salt > has atomic id incrementor functionality exposed in some way or other. > > @Rene: all that talk of maxId functions and random retries etc, etc, is > complete pooh. > don'

Re: [PHP] database abstraction layer

2010-02-02 Thread Jochem Maas
Op 2/3/10 12:19 AM, Ashley Sheridan schreef: > On Wed, 2010-02-03 at 00:21 +0100, Rene Veerman wrote: > >> the auto_increment sytnax is not uniform across servers, is it? >> >> On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan >> wrote: >> >>> I saw it happen on a site that was getting only about

Re: [PHP] database abstraction layer

2010-02-02 Thread Phpster
Lol, damn iPod corrections. The app designers is what was meant. Bastien Sent from my iPod On Feb 2, 2010, at 8:41 PM, Robert Cummings wrote: Phpster wrote: Yep, love those race conditions. We have them all over the app cuz the app ciders don't know shit! Mmmm... apple cider... to cu

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Tue, Feb 02, 2010 at 11:19:29PM +0100, Rene Veerman wrote: > oh, on using adodb.sf.net and 0-overhead for jumping between mysql and > postgresql; > > keep all your queries to as simple & early-standard sql as possible. > the auto_increment incompatibilities can be circumvented with a > relativ

Re: [PHP] database abstraction layer

2010-02-02 Thread Michael A. Peters
Robert Cummings wrote: *snip* Einstein I believe said something along the lines of "A smart person solves a problem. A wise person avoids it in the first place" Might not have been Einstein, but anyway ... Do you mean the following quote? The difference between a smart person and a wise

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Michael A. Peters wrote: Robert Cummings wrote: Rene Veerman wrote: eh thats "randomize the timing of the retry attempt".. On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote: and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i<$rn

Re: [PHP] database abstraction layer

2010-02-02 Thread Michael A. Peters
Robert Cummings wrote: Rene Veerman wrote: eh thats "randomize the timing of the retry attempt".. On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote: and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i<$rnd; $i++) { $a++ } to furt

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan wrote: The problem is where 2 people choose the same instant to perform an action on your site that inserts a record into your db. The db engine inserts them one after the other, and then responds about the max(id) to your PH

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Phpster wrote: Yep, love those race conditions. We have them all over the app cuz the app ciders don't know shit! Mmmm... apple cider... to cure what ails you or at least get you drunk enough to not care about the horrible race conditions >:) Cheers, Rob. -- http://www.interjinn.com Applica

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: On Wed, Feb 3, 2010 at 12:35 AM, Ashley Sheridan wrote: It's the reason transactions exist, to prevent things happening like this. When you have two actions where one is dependent on the other, unless you have a way to tie them together so that they can't be broken, you run

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan wrote: The problem is where 2 people choose the same instant to perform an action on your site that inserts a record into your db. The db engine inserts them one after the other, and then responds about the max(id) to your PH

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: eh thats "randomize the timing of the retry attempt".. On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote: and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i<$rnd; $i++) { $a++ } to further randomize the retry

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: i haven't had the pleasure yet of writing for sites that generate so many hits/sec that they'd update the max value of any table at exactly the same time. i usually ask for the max value about 2 milliseconds before doing the insert. And if the insert fails, i can auto-retry v

Re: [PHP] database abstraction layer

2010-02-02 Thread Phpster
Good lord that is exacty the same logic applied in our app. It only takes about 100 users to create the issue. Bastien Sent from my iPod On Feb 2, 2010, at 6:05 PM, Rene Veerman wrote: i haven't had the pleasure yet of writing for sites that generate so many hits/sec that they'd update t

Re: [PHP] database abstraction layer

2010-02-02 Thread Phpster
Yep, love those race conditions. We have them all over the app cuz the app ciders don't know shit! Bastien Sent from my iPod On Feb 2, 2010, at 5:46 PM, Ashley Sheridan wrote: On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote: function getMax($table, $field) If I saw this sort

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
On Wed, Feb 3, 2010 at 12:35 AM, Ashley Sheridan wrote: > It's the reason transactions exist, to prevent things happening like this. > When you have two actions where one is dependent on the other, unless you > have a way to tie them together so that they can't be broken, you run the > risk of col

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:31 +0100, Rene Veerman wrote: > On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan > wrote: > > > The problem is where 2 people choose the same instant to perform an > > action on your site that inserts a record into your db. The db engine > > inserts them one after the ot

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan wrote: > The problem is where 2 people choose the same instant to perform an > action on your site that inserts a record into your db. The db engine > inserts them one after the other, and then responds about the max(id) to > your PHP script. Then,

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:21 +0100, Rene Veerman wrote: > the auto_increment sytnax is not uniform across servers, is it? > > On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan > wrote: > > > I saw it happen on a site that was getting only about 3000 hits a day. It > > just takes the right combina

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:17 +0100, Rene Veerman wrote: > and after the sleep(rand(1,3)) it might need a short loop like this; > $rnd = rand(1,9); $a=0; > for ($i=0; $i<$rnd; $i++) { $a++ } > > to further randomize the retry attempt.. > > > On Wed, Feb 3, 2010 at 12:05 AM, Rene Veerman wrot

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
the auto_increment sytnax is not uniform across servers, is it? On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan wrote: > I saw it happen on a site that was getting only about 3000 hits a day. It > just takes the right combination of circumstances and it all goes pear > shaped. You really should

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
eh thats "randomize the timing of the retry attempt".. On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote: > and after the sleep(rand(1,3)) it might need a short loop like this; > $rnd = rand(1,9); $a=0; > for ($i=0; $i<$rnd; $i++) { $a++ } > > to further randomize the retry attempt.. > >

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i<$rnd; $i++) { $a++ } to further randomize the retry attempt.. On Wed, Feb 3, 2010 at 12:05 AM, Rene Veerman wrote: > i haven't had the pleasure yet of writing for sites that generate

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:05 +0100, Rene Veerman wrote: > i haven't had the pleasure yet of writing for sites that generate so many > hits/sec that > they'd update the max value of any table at exactly the same time. > > i usually ask for the max value about 2 milliseconds before doing the > inser

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
i haven't had the pleasure yet of writing for sites that generate so many hits/sec that they'd update the max value of any table at exactly the same time. i usually ask for the max value about 2 milliseconds before doing the insert. And if the insert fails, i can auto-retry via a wrapper function

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote: > function getMax($table, $field) If I saw this sort of code I'd be appalled! It's possibly the worst way to get the auto increment value. You won't notice it testing the site out on your own, but all hell will break loose when you start get

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
oh, on using adodb.sf.net and 0-overhead for jumping between mysql and postgresql; keep all your queries to as simple & early-standard sql as possible. the auto_increment incompatibilities can be circumvented with a relatively simple function getMax($table, $field) { in adodb, you'd loop through

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Tue, Feb 02, 2010 at 01:15:22PM -0800, Daevid Vincent wrote: > > -Original Message- > > From: Lars Nielsen [mailto:l...@mit-web.dk] > > Sent: Tuesday, February 02, 2010 12:24 PM > > To: php-general@lists.php.net > > Subject: [PHP] database abstraction layer > > > > Hi List > > > > I am

RE: [PHP] database abstraction layer

2010-02-02 Thread Daevid Vincent
> -Original Message- > From: Lars Nielsen [mailto:l...@mit-web.dk] > Sent: Tuesday, February 02, 2010 12:24 PM > To: php-general@lists.php.net > Subject: [PHP] database abstraction layer > > Hi List > > I am trying to make a Database Abstraction Layer so I can which the DB > of my applic

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Tue, Feb 02, 2010 at 09:23:47PM +0100, Lars Nielsen wrote: > Hi List > > I am trying to make a Database Abstraction Layer so I can which the DB > of my application between MySQL and Postgresql. I have been looking at > the way phpBB does it, and it seems that it is only then php-functions > wh

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
i'm a fan of adodb.sf.net, which i've used with both postgresql and mysql. On Tue, Feb 2, 2010 at 9:23 PM, Lars Nielsen wrote: > Hi List > > I am trying to make a Database Abstraction Layer so I can which the DB > of my application between MySQL and Postgresql. I have been looking at > the way ph

Re: [PHP] database abstraction layer

2010-02-02 Thread Lester Caine
Lars Nielsen wrote: Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application between MySQL and Postgresql. I have been looking at the way phpBB does it, and it seems that it is only then php-functions which are different. The SQL seems to be the same. Is

Re: [PHP] database abstraction layer

2010-02-02 Thread Michael A. Peters
Lars Nielsen wrote: Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application between MySQL and Postgresql. I have been looking at the way phpBB does it, and it seems that it is only then php-functions which are different. The SQL seems to be the same. Is

Re: [PHP] database abstraction layer

2010-02-02 Thread James Colannino
Lars Nielsen wrote: Is it save to assume that I can use the same SQL, or should i make some exceptions? Standard SQL should work across all SQL servers with only a few exceptions (for example, MySQL doesn't support full outer joins.) Anything that has to do with server administration, howeve

Re: [PHP] database session management with mdb2

2009-05-12 Thread Michael A. Peters
Michael A. Peters wrote: The database session management class I'm using is something I downloaded off the web several years ago. I ported it to use mdb2 but it sometimes fails in a strange way if the session is expired or if the browser sends a session cookie that does not exist. With erro

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Lester Caine
( Sorry Eric - forgot to change the email address again :( ) Eric Butera wrote: On Sat, Mar 7, 2009 at 8:04 AM, Michael A. Peters wrote: In some earlier thread (I really don't want to dig to find it) I argued for running mysql_real_escape_string right on the _POST I must concede I was definit

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Paul M Foster
On Sat, Mar 07, 2009 at 05:12:28PM -0500, Eric Butera wrote: > On Sat, Mar 7, 2009 at 5:07 PM, Paul M Foster wrote: > > On Sat, Mar 07, 2009 at 12:34:40PM -0500, Eric Butera wrote: > > > > > > > > > >> > >> PDO.  :)  Anything else is a waste of cpu cycles. > > > > I've looked into PDO, and I jus

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Eric Butera
On Sat, Mar 7, 2009 at 5:20 PM, Nathan Rixham wrote: > Eric Butera wrote: >> >> On Sat, Mar 7, 2009 at 5:07 PM, Paul M Foster >> wrote: >>> >>> On Sat, Mar 07, 2009 at 12:34:40PM -0500, Eric Butera wrote: >>> >>> >>> >>> PDO.  :)  Anything else is a waste of cpu cycles. >>> >>> I've looked

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Nathan Rixham
Eric Butera wrote: On Sat, Mar 7, 2009 at 5:07 PM, Paul M Foster wrote: On Sat, Mar 07, 2009 at 12:34:40PM -0500, Eric Butera wrote: PDO. :) Anything else is a waste of cpu cycles. I've looked into PDO, and I just didn't find it as feature-rich as the "native" (non-OO) function assortme

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Eric Butera
On Sat, Mar 7, 2009 at 5:07 PM, Paul M Foster wrote: > On Sat, Mar 07, 2009 at 12:34:40PM -0500, Eric Butera wrote: > > > > >> >> PDO.  :)  Anything else is a waste of cpu cycles. > > I've looked into PDO, and I just didn't find it as feature-rich as the > "native" (non-OO) function assortment fo

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Paul M Foster
On Sat, Mar 07, 2009 at 12:34:40PM -0500, Eric Butera wrote: > > PDO. :) Anything else is a waste of cpu cycles. I've looked into PDO, and I just didn't find it as feature-rich as the "native" (non-OO) function assortment for database types like MySQL and PostgreSQL. Can PDO be extended? I

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Nitsan Bin-Nun
I'm personally using CI DB abstraction layer, also used zend_db, they both good but as Eric said, I think PDO is a better option. On Sat, Mar 7, 2009 at 7:34 PM, Eric Butera wrote: > On Sat, Mar 7, 2009 at 8:04 AM, Michael A. Peters wrote: > > In some earlier thread (I really don't want to dig

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Eric Butera
On Sat, Mar 7, 2009 at 8:04 AM, Michael A. Peters wrote: > In some earlier thread (I really don't want to dig to find it) I argued for > running mysql_real_escape_string right on the _POST > > I must concede I was definitely wrong about that. > > The right place to do it is in a database abstracti

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Richard Heyes
Hi, > Never used pear before, but I seem to recall there being some issues where > pear did not provide very good forward support when moving to new versions > of php causing a need to recode. Is that still an issue? Don't really know. I've not really had a problem with the stuff that I've writte

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Michael A. Peters
Richard Heyes wrote: Hi, Anywhoo, that being said, does anyone have a suggestion for a good database abstraction class? Ooh, I think you'll get the odd one or two... Preferably one that already has decent support for several open source databases? PEAR::DB was good, but IIRC it's now been

Re: [PHP] Database Abstraction Class

2009-03-07 Thread Richard Heyes
Hi, > Anywhoo, that being said, does anyone have a suggestion for a good database > abstraction class? Ooh, I think you'll get the odd one or two... > Preferably one that already has decent support for several open source > databases? PEAR::DB was good, but IIRC it's now been deprecated in favo

Re: [PHP] Database Tables Relation Issue

2009-01-30 Thread Nitsan Bin-Nun
Yes that's right, until now I didn't spent time on writing another table because my job was to develop some internal system to manage the company projects & HR (we are too small, it won't make the difference). Well umm thanks, I'm going to write the blueprints for the tables :P On Fri, Jan 30, 20

Re: [PHP] Database Tables Relation Issue

2009-01-30 Thread Bastien Koert
On Fri, Jan 30, 2009 at 8:37 AM, Andrew Ballard wrote: > On Fri, Jan 30, 2009 at 3:38 AM, Nitsan Bin-Nun > wrote: > > Hi there, > > > > I'm working on something similar to mailing list in which every > registered > > user has the ability to create a mailing list and join others mailing > lists.

Re: [PHP] Database Tables Relation Issue

2009-01-30 Thread Andrew Ballard
On Fri, Jan 30, 2009 at 3:38 AM, Nitsan Bin-Nun wrote: > Hi there, > > I'm working on something similar to mailing list in which every registered > user has the ability to create a mailing list and join others mailing lists. > > My users table is something like that (in short): > > CREATE TABLE IF

Re: [PHP] Database Tables Relation Issue

2009-01-30 Thread chris smith
> I have thought of using comma-separated ID's in special field in the lists > table of the users who have joined that specific list, but I have also > thought of doing the same at the users table, then I had another solution > which is to create new table: > > create table `relations` ( > `listid

Re: [PHP] Database Tables Relation Issue

2009-01-30 Thread Edmund Hertle
2009/1/30 Nitsan Bin-Nun > Hi there, > > I'm working on something similar to mailing list in which every registered > user has the ability to create a mailing list and join others mailing > lists. > > My users table is something like that (in short): > > CREATE TABLE IF NOT EXISTS `users` ( >

Re: [PHP] Database abstraction?

2008-04-17 Thread Jason Pruim
On Apr 17, 2008, at 2:22 PM, Jim Lucas wrote: Jim Lucas wrote: Jim Lucas wrote: Jason Pruim wrote: On Apr 17, 2008, at 11:14 AM, Jim Lucas wrote: Stut wrote: On 17 Apr 2008, at 13:33, Jason Pruim wrote: Maybe I'm showing my ignorance here in programming... Maybe it's because I delt with

Re: [PHP] Database abstraction?

2008-04-17 Thread Jim Lucas
Jim Lucas wrote: Jim Lucas wrote: Jason Pruim wrote: On Apr 17, 2008, at 11:14 AM, Jim Lucas wrote: Stut wrote: On 17 Apr 2008, at 13:33, Jason Pruim wrote: Maybe I'm showing my ignorance here in programming... Maybe it's because I delt with a kid who decided to scream for a good share of

Re: [PHP] Database abstraction?

2008-04-17 Thread Jim Lucas
Jason Pruim wrote: On Apr 17, 2008, at 2:12 PM, Jim Lucas wrote: Jason Pruim wrote: On Apr 17, 2008, at 11:14 AM, Jim Lucas wrote: Stut wrote: [/snip] Both ideas worked great... Thank you! Now I do still have one question, I decided that what Jim put up worked a little bit better for

Re: [PHP] Database abstraction?

2008-04-17 Thread Jim Lucas
Jim Lucas wrote: Jason Pruim wrote: On Apr 17, 2008, at 11:14 AM, Jim Lucas wrote: Stut wrote: On 17 Apr 2008, at 13:33, Jason Pruim wrote: Maybe I'm showing my ignorance here in programming... Maybe it's because I delt with a kid who decided to scream for a good share of the night and I'm

Re: [PHP] Database abstraction?

2008-04-17 Thread Jason Pruim
On Apr 17, 2008, at 2:12 PM, Jim Lucas wrote: Jason Pruim wrote: On Apr 17, 2008, at 11:14 AM, Jim Lucas wrote: Stut wrote: [/snip] Both ideas worked great... Thank you! Now I do still have one question, I decided that what Jim put up worked a little bit better for me so I'm going off

Re: [PHP] Database abstraction?

2008-04-17 Thread Jim Lucas
Jason Pruim wrote: On Apr 17, 2008, at 11:14 AM, Jim Lucas wrote: Stut wrote: On 17 Apr 2008, at 13:33, Jason Pruim wrote: Maybe I'm showing my ignorance here in programming... Maybe it's because I delt with a kid who decided to scream for a good share of the night and I'm sleep deprived :)

Re: [PHP] Database abstraction?

2008-04-17 Thread Jason Pruim
On Apr 17, 2008, at 11:14 AM, Jim Lucas wrote: Stut wrote: On 17 Apr 2008, at 13:33, Jason Pruim wrote: Maybe I'm showing my ignorance here in programming... Maybe it's because I delt with a kid who decided to scream for a good share of the night and I'm sleep deprived :) But in my current

Re: [PHP] Database abstraction?

2008-04-17 Thread Jim Lucas
Stut wrote: On 17 Apr 2008, at 13:33, Jason Pruim wrote: Maybe I'm showing my ignorance here in programming... Maybe it's because I delt with a kid who decided to scream for a good share of the night and I'm sleep deprived :) But in my current system I have this: echo <<

Re: [PHP] Database abstraction?

2008-04-17 Thread Richard Heyes
And since no word in the English language begins with FT You're forgetting Ftork... -- Richard Heyes +-+ |Access SSH through a Windows mapped drive| |http://www.phpguru.org/sftpdrive | +-+ -- PHP General M

Re: [PHP] Database abstraction?

2008-04-17 Thread Daniel Brown
On Thu, Apr 17, 2008 at 10:24 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > SASH > > That should have been SSH of course - seems my spell checker isn't very > technical... > +-+ > |Access SSH through a Windows mapped drive| > |http://www.phpguru.or

Re: [PHP] Database abstraction?

2008-04-17 Thread Jason Pruim
On Apr 17, 2008, at 10:26 AM, Daniel Brown wrote: On Thu, Apr 17, 2008 at 10:19 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: Daniel Brown wrote: On Thu, Apr 17, 2008 at 8:38 AM, Jason Pruim <[EMAIL PROTECTED]> wrote: I took a quick look at it, and quickly realized you know more then me

Re: [PHP] Database abstraction?

2008-04-17 Thread Daniel Brown
On Thu, Apr 17, 2008 at 10:19 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: > Daniel Brown wrote: > > > On Thu, Apr 17, 2008 at 8:38 AM, Jason Pruim <[EMAIL PROTECTED]> wrote: > > > > > I took a quick look at it, and quickly realized you know more then me > :P > > > I'll dig into it more today hope

Re: [PHP] Database abstraction?

2008-04-17 Thread Richard Heyes
> SASH That should have been SSH of course - seems my spell checker isn't very technical... -- Richard Heyes +-+ |Access SSH through a Windows mapped drive| |http://www.phpguru.org/sftpdrive | +-+ -- PHP

  1   2   3   >