如何检查SQL数据库中是否存在特定值 [英] How to check paricular values exist or not in sql data base

查看:203
本文介绍了如何检查SQL数据库中是否存在特定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我想对用户名使用客户端验证,即当数据库中已经存在用户名时,它将向我发送消息.

Hi I want to use client side validation on username i.e. it will give message to me when username already exists in database.

推荐答案

使用传统的Ajax,即 XMLHttpRequest .
步骤:
1.根据文本框的用户名onchange/onblurr,将带有用户名文本的xmlhttprequest发送到服务器端.
2.在服务器端,与数据库检查用户名是否存在
3.根据结果,如果用户名已经存在,则发送回响应
4.根据客户端的响应,显示相应的消息.

试试吧!

如果需要,只需使用Google for XMLHttprequest,您将在同一文章上获得很多文章.
Use traditional Ajax, i.e. XMLHttpRequest for it.
Steps:
1. Based on username onchange/onblurr of the textbox, send a xmlhttprequest to server side with the username text.
2. On server side, check with DB about the username existence
3. Based on the result, send back response if the username already exizts
4. Based on response on client side, show the appropriate message.

Try!

If needed, just Google for XMLHttprequest, and you will get lots of articles on the same.


这篇关于如何检查SQL数据库中是否存在特定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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