Hi,
Been working on this PHP snippet and it was fine until I changed one line. I am doing this inside Wordpress so I can't echo the problems out.
"Server error"
Hopefull you guys can see where my snippet has gone wrong :))
<?php
//Create connection
//new mysqli("localhost", "user", "password", "database");
$db = mysqli_connect("localhost", "ebook","Password", "Ebook") or die("Cannot Connect to the database");
//Adding Sent Over Data
///////////////Values///////////////////
$value_name = $_POST['Name'];
$value_email = $_POST['Email'];
$value_category = $_POST['Category'];
$value_download= $row['Download'];
////////////////////////////////////////
$ChangeDownloadSQL = "SELECT Name FROM details WHERE Download=1 UPDATE Download=0";
$Changers = mysqli_query($db, $ChangeDownloadSQL);
if ($Changers) {
mysqli_fetch_assoc($ChangeDownloadSQL){
echo "Changed Details";
} else {
echo "Failed";
}
}
//CRONJOBCHECK//
//$sqlquery = "SELECT ID, Name FROM details WHERE Download=0";
$strSQL = "SELECT Name FROM details WHERE Download=1";
//RS = Record Set
$rs = mysqli_query($db, $strSQL);
if ( $rs) {
while($row = mysqli_fetch_assoc($rs)){
echo "<p>" . $row['Name'] . " " . "</p>";
echo $value_download;
}
}else{
//Display Error Message
echo '<p>';
echo mysqli_error($db);
echo '</p>';
}
echo "<p>" . $row['ID'] . $row['Name'] . "</p>";
?>