开发者

Retrieve Specific Data/Value From Database 1 Line PHP

开发者 https://www.devze.com 2022-12-30 03:34 出处:网络
I\'m just wondering how I can retrieve a specific value (only 1 thing will be returned) from a database using php.

I'm just wondering how I can retrieve a specific value (only 1 thing will be returned) from a database using php.

My query is

mysql_query(开发者_StackOverflow中文版"SELECT balance FROM users WHERE username = '". $this->username . "'")

I'm just looking for it to retrieve the data from that row so I can save it directory into a variable.


In MySQL, you can limit the number of results using LIMIT:

mysql_query("SELECT balance FROM users WHERE username = '". $this->username . "' LIMIT 1")
0

精彩评论

暂无评论...
验证码 换一张
取 消