Google
  Web www.spinics.net

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Sun, Feb 20, 2011 at 14:11, Nazish Zafar <nazish@xxxxxxx> wrote:
>
> $insert = "INSERT INTO user_info
> (login, password)
> VALUES
> ("$login", "$password");

    You're using double-quotes to encapsulate your $insert variable
data, then never closing them.  What's more, you're also using
double-quotes to encapsulate each individual variable in the query.
Rewrite $insert to this:

        $insert = "INSERT INTO user_info(login,password)
VALUES('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($password)."')";

-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Plagiarism Notes]     [Postgresql]     [Yosemite News]

Powered by Linux