为什么MySQL插入似乎工作但不插入任何东西? [英] Why does MySQL insert appear to work but not insert anything?

查看:79
本文介绍了为什么MySQL插入似乎工作但不插入任何东西?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


这让我抓狂!我有一个mysql_query调用来插入一个简单的记录:

Hi there,

This is driving me crazy! I have a mysql_query call to insert a simple record:

展开 | 选择 | Wrap | 行号

推荐答案


我甚至可以在插入后立即执行一个选择查询并拉回已经输入的数据但是当我查看数据库时它不在那里
I can even do a select query immediately after the insert and pull back the instered data but it''s not there when I look in the datanase



我怀疑它在那里,但不是你希望看到的地方。

在phpmyadmin中查看数据时没有特定的顺序,记录似乎已被随机插入。 br />
但是如果SELECT查询找到它们,它们必须在那里。


在phpmyadmin命令列或使用搜索工具查找记录

I suspect it is there but not where you expect to see it.
When viewing the data in phpmyadmin there is no particular order and records can seem to have been randomly inserted.
But if a SELECT query finds them they must be there.

In phpmyadmin order the columns or use the search facility to find the records


@code green


谢谢代码绿色。


记录不会在应该显示的PHP页面上拉回来,这使我相信记录实际上没有插入。


如果我手动粘贴生成的查询来创建记录,它列在我的页面上,但如果我把它留给上面的mysql_query()调用,它就不会出现在页面上。我也在检查相关表格的基数,所以我可以快速看到是否插入了任何内容(当我手动运行查询时基数增加,但在PHP代码中运行时基数不增加。


干杯,


马特
@code green
Thanks code green.

The record is not pulled back on the PHP page where it should be displayed, which leads me to believe the record is not actually inserted.

If I paste in the generated query manually to create the record, it is listed on my page, but if I leave it to the above mysql_query() call, it doesn''t appear on the page. I''m also checking the cardinality of the table in question, so I can see quickly if anything is being inserted (the cardinality increases when I run the query manually, but not when it is run from within the PHP code.

Cheers,

Matt


我不确定这个问题,但有一件事我建议不要要避免以下代码:
I am not sure about the problem but, one thing i would suggest not to avoid
your code below:
展开 | 选择 | Wrap | 行号


这篇关于为什么MySQL插入似乎工作但不插入任何东西?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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