将数据从一个表传输到另一个表 [英] Transferring data from one table to another
本文介绍了将数据从一个表传输到另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用PHP和MySQL编写一个工作订单系统,而且我仍然坚持两件事 - 传输数据和更新数据。
这是我的代码:
我正在使用checklogin.php完成大部分工作,所以这很可能是我在这里缺少的东西。
checklogin.php
I''m writing a work order system using PHP and MySQL and I''m stuck on two things-transferring data and updating the data.
Here is my code:
i''m using checklogin.php to do most of everything so it''s most likely something I''m missing here.
checklogin.php
展开 | 选择 | Wrap | / span> 行号
推荐答案
任何人?有任何想法吗? ..............
Anyone? Any ideas? ..............
感谢您替换我的实际信息。大声笑我很担心每个人都看到它。
Thank you for replacing my actual information. LOL I was quite worried about everyone seeing it.
嘿。
你有什么问题,确切地说?
您对代码的期望是什么?它到底在做什么?
你收到任何错误信息吗? - 我们喜欢错误信息:)
(请记住,我们实际上无法在自己的测试机器上运行代码。)
我注意到的一些事情可能会有所帮助。
- 在两个代码示例中,您连接到MySQL两次。这是不必要的,浪费资源。对 mysql_connect 函数的单次调用就足够了,除非您有特殊原因需要更频繁地调用它。
- 在第31行和第32行,您使用 session_register 功能。此函数已弃用,不应再使用。 - 相反,你应该像这样注册会话变量:
Hey.
What are you having problems with, exactly?
What are you expecting the code to do? What is it actually doing?
Are you getting any error messages? - We LOVE error messages :)
(Keep in mind that we can''t actually run the code on our own test machines.)
A few things I notice, though, that may help.
- In both of your code examples, you connect to MySQL twice. This is unnecessary, and a waste of resources. A single call to the mysql_connect function is enough, unless you have a specific reason for needing to call it more often.
- On lines #31 and #32 you use the session_register function. This function is deprecated and should not be used anymore. - Instead, you should register session variables like so:
展开 | 选择 | Wrap | 行号
这篇关于将数据从一个表传输到另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文