chrisgjh chrisgjh - 1 month ago 7
MySQL Question

Is there a way to make my credential information not return after I insert it into my database

Lets say if I wanted to insert an user infomation into

Users
table in my database, the following is a json format of the information I want to insert:

{
'id': 1,
'username': 'asd123',
'password': 'abc123'
}


How can I make it return only the
id
and the
username
when I do a
SELECT * FROM Users WHERE id = 1

Answer Source

Instead of

SELECT *

use

SELECT id, username

Explanation: * is used when we want all columns, otherwise use the specific column names. Use * only when it is required.