Results 1 to 11 of 11

Thread: [RESOLVED] [PHP] Database interface

Threaded View

  1. #5

    Thread Starter
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: Database interface

    Quote Originally Posted by visualAd View Post
    Have you considered using PDO?
    I haven't, but I might, now that I've read that.
    Should I be worried about webhosters not having PDO enabled?

    Quote Originally Posted by kows View Post
    I would personally suggest writing methods that allow you to create prepared statements; they are absolutely invaluable and remove the chance of a user opening themselves up to SQL injection.
    I've never worked with them in PHP but I see PDO has support for prepared queries, so I might consider that.

    Quote Originally Posted by techgnome View Post
    try taking a look at CodeIgniter http://codeigniter.com/ look through their Database Class in the User Guide ... should give you a pretty good idea of what to look for.

    -tg
    After a quick glance I at least found one function I really like;
    Code:
    $data = array(
                   'title' => $title,
                   'name' => $name,
                   'date' => $date
                );
    
    $this->db->insert('mytable', $data);
    
    // Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
    PDO would be awesome, but the only question that remains is scale of deployment.
    Thanks for the suggestions so far.
    Last edited by TheBigB; Sep 21st, 2010 at 05:33 AM.
    Delete it. They just clutter threads anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width