Quick help..my eyes are tired.. what am I missing?
Posted: Mon Apr 11, 2016 9:09 am
What am I missing?
I been staring at this for several minutes but can't find what I'm missing.
It wont work it skips the entire thing..
Thanks in advance
Code: Select all
echo $Deviation_ID; //FOR TEST PURPOSE
if ($stmt = $mysqli->prepare("SELECT Logfile FROM Deviation_Update_History WHERE ID = ?")) {
$stmt->bind_param('i', $Deviation_ID);
$stmt->execute();
$stmt->bind_result($Logfile);
$stmt->store_result();
$stmt->fetch();
if (mysqli_num_rows($result) > 0) {
$Logfile="1"; //Just for test
if ($stmt = $mysqli->prepare("UPDATE Logfile SET Deviation_Update_History WHERE ID = ?")) {
$stmt->bind_param('is', $Deviation_ID, $Logfile);
$stmt->execute();
$stmt->close();
} else { //If doesnt exist
$Logfile="2"; //Just for test
if ($stmt = $mysqli->prepare("INSERT INTO Logfile(Dev_ID, Logfile) VALUES (?) WHERE ID = ?")) {
$stmt->bind_param('is', $Deviation_ID, $Logfile);
$stmt->execute();
$stmt->close();
}
}
}
}It wont work it skips the entire thing..
Thanks in advance