NEVER EVER put variables in a query. Use Prepared Statements.
Do not SELECT *. Specify the columns you want by name
Do not use two query’s when you only need one.
If your “existing content” check is for an existing username and/or email, DONT. Set a unique constraint on the columns, attempt the insert and capture the duplicate error if any.