为什么我的“数据库插入”不能在生产中使用? [英] Why does my 'database insert' not work in production?

查看:73
本文介绍了为什么我的“数据库插入”不能在生产中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的网络应用程序从开发(本地计算机)移动到生产(Web服务器),我插入数据库的脚本不能正常工作。


这是脚本:

展开 | 选择 | Wrap | 行号

解决方案

它可能是。你需要开始调试。


他应该如何开始调试?


@OP它是否适用于你的测试环境?两个环境是否相同?你有相同版本的PHP和MySQL吗?服务正在运行吗?


这很尴尬。


我连接的是错误的数据库。所以,是的,解决了这个问题。


但是,虽然我从数据库中读取数据,但我无法获得插入。我几乎肯定它应该有效。我甚至在执行insert语句后添加一行显示错误消息,但浏览器直接通过它。它将图像插入到它应该的目录中,然后显示javascript警报,然后继续数据库插入,运行到javascript重定向并转到它应该的页面。所以,除了当我检查数据库并且应该插入的值实际上不在那里时,一切似乎都在工作。


无法理解。

I moved my web app from development (local machine) to production (web server) and the script I have that inserts to the database won''t work.

This is the script:

Expand|Select|Wrap|Line Numbers

解决方案

it could be. you?ll need to start debugging.


And how should he "start debugging"?

@OP did it work in your test environment? Are the two environments the same? Do you have the same version of PHP and MySQL? Are the services running?


This is embarrassing.

I was connecting to the wrong database. So, yeah, fixed that problem.

However, although I''m getting the read from the database, I can''t get the insert. I''m almost sure it should work. I even put a line to display an error message after the execution of the insert statement, but the browser goes straight past it. It''s inserting the image to the directory it''s supposed to, then displays the javascript alert, then goes on the databse insert, runs past that to the javascript redirect and goes to the page it''s supposed to. So, everything seems to be working except for when I check the database and the values that were supposed to be inserted are not actually in there.

Can''t figure it out.


这篇关于为什么我的“数据库插入”不能在生产中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆