[wp-hackers] wpdb Outside of WordPress

CloudPress Hosting cloudpresshosting at gmail.com
Fri Nov 16 23:21:41 UTC 2012


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> 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
> 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
> 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> 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
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
>
> --
> David F. Carr
> Writer, Editor, Web Consultant
> 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
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list