简体   繁体   English

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

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

I created a website which was fully functional on my computer's MAMP. 我创建了一个网站,该网站可以在我的计算机的MAMP上正常运行。 When I placed it on the server, everything works well except for the fact that I cannot insert a new user into the DB. 当我将其放置在服务器上时,除无法将新用户插入数据库外,其他一切工作正常。 I'm partially concerned that the SSL cert is interrupting it, but I don't know enough about this to determine that. 我有些担心SSL证书正在中断它,但是对此我还不了解。 To troubleshoot this I did the following: 为了解决这个问题,我做了以下工作:

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

Further, all my php sql statements have built in mysqli_error($conn) which show no errors, and when I attempted a basic 此外,我所有的php sql语句都内置了mysqli_error($ conn),它不显示任何错误,并且在我尝试基本

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

scenario, it was unsuccessful. 场景,这是不成功的。

My feeling that it is the ssl stems from the fact that my other (non-encrypted) sites don't have this problem. 我认为这是ssl的原因是我的其他(未加密)站点没有此问题。 Is there something basic I'm missing? 我缺少一些基本的东西吗?

Its not the SSL, its your configuration. 它不是SSL,而是您的配置。 See into it. 看看吧。 If you can insert while doing it in the phpmyadmin with a raw sql, then check your config like the hostname user and db name. 如果您可以在使用原始sql的phpmyadmin中进行插入的同时插入,请检查您的配置,例如主机名用户和数据库名。 What server you are using? 您正在使用什么服务器?

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

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