可以连接到服务器上的数据库但无法插入。适用于 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,而是您的配置。看进去。如果您可以在 phpmyadmin 中使用原始 sql 插入,然后检查您的配置,例如主机名用户和数据库名称。您使用的是什么服务器?
我创建了一个网站,该网站在我计算机的 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,而是您的配置。看进去。如果您可以在 phpmyadmin 中使用原始 sql 插入,然后检查您的配置,例如主机名用户和数据库名称。您使用的是什么服务器?