Jump to content

Recommended Posts

For some reason the result keeps comming up null. All the echos are there to see if the values are there at certain points and ill take out once it works...

 

The checkClockIn function is called from another file but I know its ok because $emp has a value so i know i declared the class in the other file correctly.

 

<?php
public function checkClockIn($emp, $pin)
{
	$sql = "SELECT PIN FROM tblEmployees WHERE empId='$emp'";

	$pof = $this->dbQuery($sql);

	echo $pof;

	if ($pin == $pof)
	{
		return true;
	} else {
		return false;
	}

public function dbQuery($query)
{
	$result = mysql_query($query);

	$row = mysql_fetch_array($result);
	$answer = $row[0];
	echo $row;	
	return $answer;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/51218-classmysql-query-problem/
Share on other sites

I have a file /includes/dblib.php that contains about 2 dozen functions for querys to the database but i thought putting all that on here would annoy people :)

 

$pof is the value of the employee's pin number in the database and $pin is the number the employee entered in the login form. $emp has its value but $pof (the result from the db) is null so all the echos dont return anything at all.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.