Hiya,
I have seperated out my PHP code into many different layers
For example Login.html displays login screen to user. They enter details which is posted to login.php. Within login.php have some code which does something similar to
if login(username, password)
{
//do something
}
login.php calls user.api which defines the login function.
function login(username, password)
{
$querystring = ("select * from user
where username='$username'
and password = password('$password')");
db_query($querystring)
This calls the function db_query in db.api.php :
function db_query($querystring)
{
$db_result = mysql_query($querystring);
}
Now the problem is that one person advised me it is not good to send the whole querystring to db.api and to use $REQUEST instead of $SESSION im using to pass globval variables.
Now the reason I designed it like this was to be able to change the database in one file db.api.php if neccessary.
Can anyone tell me how I can use $_REQUEST and also keep some level of database abstraction from the user.api.php, the login.php and login.html
Any suggestions would be great
PS ( how hard would it be to convert all my db code to work with PEAR db)
Cheers
Bobster