使用PHP无需提交按钮从mysql数据库中检索数据 [英] Retrieve data from mysql database using PHP without submit button

查看:96
本文介绍了使用PHP无需提交按钮从mysql数据库中检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在尝试使用html表单,当用户输入ID时,它会自动查询返回数据的mysql数据库中的select命令与他的身份证有关



例如:



ID:

姓名:



我希望当用户输入他的ID时,立即填写姓名而不使用提交按钮,他必须留在同一页面(至填写其他信息)



我尝试过:



我'我试图把像php代码放在input type =textvalue =php脚本中,从数据库中选择

但它不起作用..



任何想法都赞赏。

解决方案

你需要AJAX,访问 PHP AJAX和MySQL [ ^ < /一>

Hello,

I am trying to have an html form, that when the user enters an ID it automatically queries a select command from a mysql database that returns data that are related to his ID

For example:

ID:
Name:

I want that when the user enters his ID, instantly the name will be filled without using a submit button and he must stay in the same page (to fill other info)

What I have tried:

I've tried to put like a php code inside the "input type="text" value="php script that has select from database"
But it's not working..

Any ideas appreciated.

解决方案

You need AJAX, visit PHP AJAX and MySQL[^]


这篇关于使用PHP无需提交按钮从mysql数据库中检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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