Ex. mysql_query("SELECT * FROM members WHERE id='$id');
It's a wildcard it means return all columns for that table in the result set.
SELECT is used to retrieve rows selected from one or more tables, and can include UNION operations and subqueries. Beginning with MySQL 8.0.
Selecting All Fields. The asterisk "*" is used in conjunction with the SELECT keyword to select all fields from a table or a query.
The asterisk tells the database to select all data in the table.
It means select all columns in the table.
It means that you are selecting every column in the table. This is something you should avoid in production environments though because it causes a bit of overhead and things tend to break when you alter your tables and use the *
selector.
A better way to do this is to select only the columns you need each time, like the following example:
SELECT `id`, `firstName`, `lastName` FROM members WHERE id='$id'
Select ALL fields from some table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With