繁体   English   中英

可以连接到服务器上的数据库,但不能插入。 适用于Mamp localhost

[英]Can connect to database on server but cannot insert. Works on mamp localhost

我创建了一个网站,该网站可以在我的计算机的MAMP上正常运行。 当我将其放置在服务器上时,除无法将新用户插入数据库外,其他一切工作正常。 我有些担心SSL证书正在中断它,但是对此我还不了解。 为了解决这个问题,我做了以下工作:

1. confirmed the connection works by returning row numbers and data that I manually placed into the database

2. confirmed openSSL is active/on

3. confirmed proper placement of my ssl certs through a separate site that confirms their presence

4. checked the error log on the server (which showed no errors) and then created a script to cause an error as proof of principle it works

5.confirmed the phpmyadmin user has full privledges

6. I have two user types and scripts that both don't work that worked on MAMP so I'm fairly confident its not poor coding

此外,我所有的php sql语句都内置了mysqli_error($ conn),它不显示任何错误,并且在我尝试基本

 "INSERT INTO users (name) VALUES ('john')" 

场景,这是不成功的。

我认为这是ssl的原因是我的其他(未加密)站点没有此问题。 我缺少一些基本的东西吗?

它不是SSL,而是您的配置。 看看吧。 如果您可以在使用原始sql的phpmyadmin中进行插入的同时插入,请检查您的配置,例如主机名用户和数据库名。 您正在使用什么服务器?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM