From c644128fdd49a47d791240e0e38b54cd22412bc5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 4 Jul 2007 23:54:32 +0000 Subject: fixed validation errors... about a zillion of em. --- user_guide/database/queries.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'user_guide/database/queries.html') diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index e55a5328a..013d64f33 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -95,15 +95,13 @@ CodeIgniter has two functions that help you do this:

  • $this->db->escape() This function determines the data type so that it can escape only string data. It also automatically adds single quotes around the data so you don't have to: -$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")"; +$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
  • $this->db->escape_str() This function escapes the data passed to it, regardless of type. Most of the time you'll use the above function rather then this one. Use the function like this: -$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')"; - -
  • +$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')"; @@ -134,7 +132,7 @@ Previous Topic:  Connecting to your Database Top of Page   ·   User Guide Home   ·   Next Topic:  Query Results -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    -- cgit v1.2.3-24-g4f1b