SQL execution is normal. php execution has an error ~

Source: Internet
Author: User
SQL execution is normal. php execution has an error ~~ The error is Access & nbsp; denied & nbsp; for & nbsp; user: & nbsp; 'odbc @ localhost' & nbsp; (Using & nbsp; password: & nbsp; NO) I used a blank password before, and there was no error. now there are no errors in other files, so there is no problem in executing this SQL statement in php ~~
The error is Access denied for user: 'odbc @ localhost' (Using password: NO)
I used a blank password before, and there was no error. now there are no errors in other files. this error is caused by the following code:

Error_reporting (0 );
Session_start ();
Require ('../libs/Smarty. class. php ');
$ Smarty = new Smarty;
// $ Smarty-> force_compile = true;
$ Smarty-> debugging = false;
$ Smarty-> caching = false;
$ Smarty-> cache_lifetime = 120;



If ($ _ POST ['OK']. value = 1)
{
$ Username = $ _ POST ['username'];
$ Userpwd = $ _ POST ['userpwd'];
$ Query = mysql_query ("insert into user (user, pwd) values

('$ Username',' $ userpwd ') ") or die (mysql_error ());
If ($ query)
{
$ Response = "script" alert ('registered successfully'); script
";
}
Else
{
$ Response = "script alert ('registration failed'); script";

}
}
$ Smarty-> assign ("regstatus", $ response );
$ Smarty-> display ("reg.html ");
?>

------ Solution --------------------
When no one answers the question, you can manage menu-> to delete the post.
------ Solution --------------------
So, look for the reason first.
Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.