Hi, I'm just learning PHP and I'm trying to figure out how I could store my database queries in a separate file either as part of a class, method or just as simple variables.
For example: I have a query that looks like this:
$checkuser = mysql_query("SELECT UserName, Email FROM users
WHERE UserName = '$username4db' OR EMAIL = '$email4db'")
or die($checkuser_error);
Instead of writing it inline within the file, I'd like to move this to a central place and then use them from there.
I tried using an include file and simply calling the variable in place but it doesn't work.
Can some one help please? Thanks!