Re: Submitting data to MySQL database using HTML/PHP form

From: Date: Mon, 21 Feb 2011 09:13:31 +0000
Subject: Re: Submitting data to MySQL database using HTML/PHP form
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-311490@lists.php.net to get a copy of this message
On 20/02/11 21:37, Nazish wrote:
Issue resolved! It turned out to be the use of quotations. Instead of double quotations to surround the $insert variable, it worked with single quotations: $insert = ' INSERT INTO user_info
        (login,password)
        VALUES
        ("'.$login.'", "'.$password.'") ' ;
With the real_escape_string, this version worked (double quotation on the outside, single quotation on the inside): ( " '.mysql_real_escape_string($login).' ", " '.mysql_real_escape_string($password).' ")'; I'm not sure why the use of quotations works differently in different cases? Thanks for your insights! It really helped with diagnostics. Much appreciated!
Nazish, Find yourself an editor or development environment that does source code highlighting - this sort of error will be very obvious in such a program. I'm not going to recommend one - that's a sure way to start an argument - but I use Netbeans. Cheers Pete -- Peter Ford, Developer phone: 01580 893333 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS

« previous php.general (#311490) next »