0

I have just gotten into using premade statements to help with SQL protections. My script checks to see if the User exists in the Users table and if it does already exist it runs:

$stmt = $Con->prepare("UPDATE `HA00`.`Users` SET `Unix` = ?,`4690` = ?,`LastIP` = ?,`LastLogin` = CURRENT_TIME( ) WHERE `Users`.`User` = ?;");

$stmt->bind_param('ssss',$PUnix,$P46,$IP,$PAD);
$PAD = $AD;
$PUnix = $Unix;
$IP = $_SERVER['REMOTE_ADDR'];
$P46 = $CTR;
$stmt->execute();

If the user doesn't exist theirs is a nearly identical Insert SQL Query that works fine. I am positive I am missing something simple. I have checked the other pages but I am not finding the issue.

Edit:

"var_dump($stmt);" shows bool(false)

MoonEater916
  • 436
  • 2
  • 6
  • 19

2 Answers2

0

It cant see parameters $PUnix,$P46,$IP,$PAD.

Try putting $stmt->bind_param('ssss',$PUnix,$P46,$IP,$PAD); below those variables.

Victor1224
  • 11
  • 1
0

Try use $stmt->bindValue instead. It should work.

Apetu Gideon
  • 136
  • 1
  • 5