So what exactly happens when you run this? Do you get an error message? Do you get a blank page? Does it output a value you don’t expect? Does it output nothing at all? Is this just a snippet of the code, and is there other markup around it, or is this the whole dashboard.php file?
Need a bit more information about the context to give more specific advice.
Overall though, you have a few issues here with security. The most important being that you have a pretty big sql injection vulnerability here (probably, this looks like just a snippet so perhaps you sanitize your variables in a different part of the code).
I’m also curious why you use like rather than an equality check. Is that just the new way of doing things in PHP? Like is generally a pretty resource intensive check so it seems like your doing an inefficient check for no real benefit. Maybe your just following a tutorial and the reasoning is there? I haven’t written raw PHP in a while (everyone uses frameworks no a days) so maybe this is just the new way of doing things.
You also doing have a closing curly bracket to that if statement. I’m assuming that’s because the code above is just a snippet, and you forgot to copy that part of it, but if not you can try adding that closing curly bracket and see if that helps.