I am trying to call a stored procedure in php-myadmin from wordpress website to check user login details.
I have a button that points to javascript function:
<input type="submit" value="Login" onclick="checkloging()">
The javascript file contains ajax:
function checkloging() {
$.ajax({
type: "POST",
url: 'checklogin_php',
data:{action:'call_this'},
success:function(html) {
alert(html);
}
});
}
The ajax code is to call a php file:
<?php
//Call the proc() procedure follow
$result= mysql_query("CALL checkpassword('username', 'password');") or die(mysql_error());
while($row = mysql_fetch_row($result))
{
for($i=0;$i<=6;$i++)
{
echo $row[$i]."<br>";
}
}
mysql_close($con);
?>
which invokes a stored procedure in phpmyadmin.
Please can any anyone help with this? I am not not sure if this is a good approach and I'm not getting it to work.