下载php / mysql [英] drop down php/mysql

查看:40
本文介绍了下载php / mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


这是我第一次尝试与php / mysql有关,所以任何帮助都将不胜感激。


我设置了一个挑战,想出一个网络应用程序,让员工登录页面,在下拉框中选择他们的名字,然后设置他们当前的位置和时间,因为离开该位置。然后按提交更新他们在员工数据库中的记录。


到目前为止,我已将数据库中的任何名称加载到下拉框中,并在位置和时间中输入2个其他文本字段细节。找一个时间函数是另一天!


这里是我的代码:

Hi all,

This is my first attempt at anything to do with php/mysql so any help will be greatly appreciated.

I have been set a challenge to come up with a web app to enable staff to log on to the page, select their name in a drop down box and then set their current location and time due to leave that location. Then press submit to update their record on staff database.

So far I have gotten any names in database loaded into a drop down box and have 2 further text fields to enter in location and time details. Finding a time function is for another day!

here''s my code:

展开 | 选择 | Wrap | 行号

推荐答案

好的,MySQL需要是一个 更新 查询。您还需要知道如何获取下拉列表的选定值(我将在下面解释)。但是,目前,查看您的表单存在一个问题:您< form>没有动作方法。不是巨大的问题,但最好告诉您的表单您希望它做什么。我希望表单发布到同一页面,但我不知道你是打算使用GET还是POST(或者你是否知道那些?)。我假设你会使用POST。制作你的< form>进入:

Ok, the MySQL will need to be an UPDATE query. You will also need to know how to get the selected value of the dropdown (I will explain that below). However, currently, looking at your form, there is a problem: you <form> has no action or method. Not a huge issue, but it is good practice to tell your form what you want it to do. I expect the form is posting to the same page, but I don''t know whether you plan on using GET or POST (or if you even know about those?). I''ll assume you will use POST. Make your <form> into this:

展开 | 选择 | Wrap | 行号


@Markus


它是POST到drop.php,第28行。只有一个< form>太多了。


顺便说一句。 "动作"是一个必需的属性
@Markus
it''s a POST to "drop.php", line 28. there''s just one <form> too many.

btw. "action" is a required attribute


所以代码是如此糟糕以至于无法使其工作?
so is the code so bad that it can''t be made to work?


这篇关于下载php / mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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