I'm looking to get other information when logging into my database. I'm looking to get the TechID of the tech that has successfully signed in and store it within "output" in the second section. Wondering if you could help.
PHP:
$myusername=$_POST['username'];
$mypassword=$_POST['password'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT TechNo, TechName, TechUser,TechPass FROM $tbl_name
WHERE TechUser='$myusername' and TechPass='$mypassword'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1)
{
echo "***TechID goes here";
}
else
{
echo 'false';
}
Post Method:
function checkEvents()
{
var username = $("#username").val();
var password = $("#pass").val();
$.post('checklogin.php', {username: username, password: password},
function(output){
if(output == 'false')
{
Win('#geteventslogin', 0);
popupcetion('#loginfailed', 1);
}
else
{
Win('#geteventslogin', 0);
alert(output); ///output = TechID number.
popupcetion('#getevents', 1);
}
});
}
What im trying to do is display a list of jobs from another database, each tech is assigned jobs and i want only to display the correct jobs for that tech. This question has probably been asked before. If you could point me towards a post or answer my question, i would be much appreciative.
Thanks in advance.