Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2811

Re: Adding a record to a database

From JohnT <john@example.com>
Newsgroups comp.lang.php
Subject Re: Adding a record to a database
Date 2011-08-15 13:45 +0000
Organization A noiseless patient Spider
Message-ID <j2b7tf$85c$1@dont-email.me> (permalink)
References <15482cdd-93d6-4d9c-98ea-e4b1c92261a9@m4g2000pri.googlegroups.com>

Show all headers | View raw


On Mon, 15 Aug 2011 05:35:37 -0700, Charles wrote:

> 
> 
> ('$_POST[Make]','$_POST[Model]','$_POST[Edition]','$_POST

Start here - you can't put complex variables in a string unless you quote 
them like:

('{$_POST[Make]}','{$_POST[Model]}','{$_POST[Edition]}',

However - you should not be putting these directly into the database.
You should first validate in the input, and then quote the strings to 
make them database safe:

('".mysql_real_escape_string($_POST[Make])."',

JohnT

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Adding a record to a database Charles <cchamb2@gmail.com> - 2011-08-15 05:35 -0700
  Re: Adding a record to a database Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-15 08:46 -0400
  Re: Adding a record to a database JohnT <john@example.com> - 2011-08-15 13:45 +0000
  Re: Adding a record to a database A.Reader <anonymously@example.com> - 2011-08-15 14:11 -0400
    Re: Adding a record to a database sheldonlg <sheldonlg@thevillages.net> - 2011-08-15 21:02 -0400
      Re: Adding a record to a database Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-15 21:50 -0400
        Re: Adding a record to a database Charles <cchamb2@gmail.com> - 2011-08-16 01:30 -0700
          Re: Adding a record to a database A.Reader <anonymously@example.com> - 2011-08-16 05:41 -0400
            Re: Adding a record to a database Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-16 06:23 -0400
              Re: Adding a record to a database A.Reader <anonymously@example.com> - 2011-08-16 09:11 -0400
                Re: Adding a record to a database Tim Streater <timstreater@greenbee.net> - 2011-08-16 14:51 +0100
                Re: Adding a record to a database A.Reader <anonymously@example.com> - 2011-08-16 10:42 -0400
                Re: Adding a record to a database Tim Streater <timstreater@greenbee.net> - 2011-08-16 16:58 +0100
                Re: Adding a record to a database Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-16 17:21 -0400
          Re: Adding a record to a database Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-16 06:17 -0400
        Re: Adding a record to a database sheldonlg <sheldonlg@thevillages.net> - 2011-08-16 16:13 -0400
          Re: Adding a record to a database Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-16 17:24 -0400

csiph-web