[wp-hackers] wpdb Outside of WordPress

Scott Taylor scott.c.taylor at mac.com
Sat Nov 17 19:20:35 UTC 2012


wpdb is based on: https://github.com/jv2222/ezSQL

Those who work on WP core want to make wpdb work well for WordPress, not make a one-size-fits-all solution for all PHP environments. But there's nothing stopping anyone else (you) from doing that, and others would probably appreciate it 

-- 
scott taylor
musician / software engineer
160 west end ave #2H 
new york, ny 10023
m 646.715.7347
twitter: wonderboymusic
web: scotty-t.com


On Friday, November 16, 2012 at 6:21 PM, CloudPress Hosting wrote:

> I normally just use mysqli but for consistency since I am used to wpdb when
> working with WordPress figured I could use it outside of WordPress as well.
> 
> On Fri, Nov 16, 2012 at 1:54 PM, scribu <mail at scribu.net (mailto:mail at scribu.net)> wrote:
> 
> > Note that there's an object-oriented MySQL abstraction built right into
> > PHP, called PDO.
> > 
> > Here's just one of many articles that describes the advantages of PDO:
> > http://net.tutsplus.com/tutorials/php/pdo-vs-mysqli-which-should-you-use/
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com (mailto:wp-hackers at lists.automattic.com)
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> > 
> 
> Seems like overkill to load up a whole instance of WordPress just to access
> a database. Shouldn't take much modification to the wpdb class to remove
> the WordPress specific stuff and you can use it directly. It should be
> possible to use it as is I believe I would just clean it up a little by
> removing the WordPress specific stuff.
> 
> On Fri, Nov 16, 2012 at 2:07 PM, David F. Carr <david at carrcommunications.com (mailto:david at carrcommunications.com)
> > wrote:
> 
> 
> > I've often created standalone PHP scripts, for example to be used with cron
> > job, that simply include "/pathto/wp-config.php" and then make use of the
> > $wpdb object.
> > 
> > Standard disclaimers apply about security concerns / protecting your
> > database.
> > 
> > On Fri, Nov 16, 2012 at 4:54 PM, scribu <mail at scribu.net (mailto:mail at scribu.net)> wrote:
> > 
> > > Note that there's an object-oriented MySQL abstraction built right into
> > > PHP, called PDO.
> > > 
> > > Here's just one of many articles that describes the advantages of PDO:
> > http://net.tutsplus.com/tutorials/php/pdo-vs-mysqli-which-should-you-use/
> > > _______________________________________________
> > > wp-hackers mailing list
> > > wp-hackers at lists.automattic.com (mailto:wp-hackers at lists.automattic.com)
> > > http://lists.automattic.com/mailman/listinfo/wp-hackers
> > > 
> > 
> > 
> > 
> > 
> > --
> > David F. Carr
> > Writer, Editor, Web Consultant
> > david at carrcommunications.com (mailto:david at carrcommunications.com)
> > http://www.carrcommunications.com/
> > 
> > Editor, The BrainYard http://www.informationweek.com/thebrainyard
> > LinkedIn - http://www.linkedin.com/in/davidfcarr
> > Facebook - http://www.facebook.com/carrcomm
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com (mailto:wp-hackers at lists.automattic.com)
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> > 
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com (mailto:wp-hackers at lists.automattic.com)
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 




More information about the wp-hackers mailing list