I am working on a fairly large program for my skill level. I just started learning php within the last couple of months so please take that into consideration. Im not asking anyone to do my work for me as I really need/want to learn this on my own, im just having troube picking up on some things... any help or guidance is much appreciated..
i am re-writing an existing program to try to make the code more effecient , i am currently trying to make less code than there is, code that is easier to read, with this example i am trying to combine a couple of pages of code and mix-breed the code to take what the other developer already wrote and make it work with my code.
I am trying to blend these two functions and i am getting a parse error ....
///////////////////////////////////// old function
function authenticate_user($p_LDAP_ID, $p_PASSWORD = '')
{
global $connection;
$query = "SELECT * FROM teachers T, schools S, stu_enr WHERE T.SCHOOL = S.SCHOOL(+) AND LDAP_ID = '$p_LDAP_ID'";
$oci = new oci_query($query, $connection);
if ($oci->num_rows() == 0)
return false;
else
{
return $oci->fetch_array();
}
}
///////////////////////////////////// merged function
function authenticate_user($p_LDAP_ID, $p_PASSWORD = '',$conn)
{
//global $connection;
$query = "SELECT * FROM teachers T, schools S, stu_enr WHERE T.SCHOOL = S.SCHOOL(+) AND LDAP_ID = '$p_LDAP_ID'";
// $oci = new oci_query($query, $connection);
// if ($oci->num_rows() == 0)
// return false;
// else
// {
// return $oci->fetch_array();
// }
// }
$statement = OCIParse($conn, $query);
if(OCIExecute($statement) -> num_rows() == 0){
return false;
else
{
return $oci->fetch_array();
}
}
}
Thanks again for anyone that can help ...