Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
column wildcards in SELECT #7
in server/user/reset.php the select for the user uses "SELECT *", this can be rewritten as "SELECT username", this will reduce the information transmitted, allows using of covering index and is generally best practice for SQL.
Instead of $userarray I would also use a $username variable (like ...)
in server/user/requestreset.php the same "SELECT username" can be used. This code already uses the $username variable
There is a third wildcard in functions-global.inc.php # getUser(), but in that case it is a somewhat dynamic list of columns (nevertheless they could be expliciteley specified)
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
Yes, the last select * is this one:
includes/functions-global.inc.php: $result = $db->query("SELECT * FROM user
It somewhat uses the * to allow dynamic columns for the user attributes (if I remeber right). I would code them into a config setting. This will enforce database consistency.