简体   繁体   中英

Run through a column in the mysql table for a specific word

I have a url problem.

When the user types in this url: "www.example.com/username", it uses htaccess rewrite and goes to that username's profile. The problem comes when there is a directory by the same name as the username. This creates an error and to get around it, I am going to capture the word from the url and go through the user database searching for the name grabbed from the url. If it is found under the members name column, it goes forward for the user profile and if it is not, it goes to the directory. How would I run through the mysql table just to see if the mysql table has the name?

I appreciate your help, thanks!

您宁愿在注册阶段检查是否存在具有该名称的文件夹,但是要查找的支票与用于在注册页面上查找用户名是否已使用的支票相同100%。

select count(*) from users where username = $user

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM