Sorry I’ve take a while… Having some issues at home. The video page will goge somewhere on the Maranatha.tv site I noticed the two querys and I removed the second one, but it did not help.
Here’s my query so far:
[php]<?PHP
session_start();
//print_r($_POST);
//die();
// Set up database connection…
include(‘connect.php’);
//CRATE SHORT VARIABLE NAMES
$videoID = $_POST[‘videoID’];
$updateVideo = isset($_POST[‘updateVideo’]);
$deleteVideo = isset($_POST[‘deleteVideo’]);
$videoName = mysql_real_escape_string($_POST[‘videoName’]);
$videoDescription = mysql_real_escape_string($_POST[‘videoDescription’]);
// Handle Video Updates…
if(isset($updateVideo)) {
// Update the Video’s data, if it does not exist then insert new version…
$query = “UPDATE videos SET videoName=’$videoName’, videoDescription=’$videoDescription’, lastUpdated=’” . date(‘Y-m-d H:i:s’). “’ WHERE videoName = ‘$videoName’ AND videoID =’$videoID’” ;
//**************
//echo(“QUERY=” . $query); echo(“
records=” . mysql_affected_rows());
if (mysql_affected_rows()==0) {
$query = “INSERT INTO videos SET videoName =’$videoName’, videoDescription = ‘$videoDescription’, lastUpdated= '” . date(‘Y-m-d H:i:s’) . “’,
timeUpdated) = '” . date(‘g:i:s’) . “’”;
$result = mysql_query($query) or mysql_error();
}
}
if(isset($deleteVideo)) {
// Delete the Video…
$query = "DELETE FROM videos WHERE videoName = ‘$videoName’ ";
//$dbConn = mysql_query ($query);
}
//mysql_close($dbConn);
// After update or delete is completed, go back to ADMIN page…
//header(“Location:videoAdmin.php”);
?>
[/php]
I added the videoID variable to the page… don’t you hink we need it? Anyway, without it, the result is the same. I think we need to use mysql_fetch_row() somewhere like we did before.
Also, I deliberately entered junk query and no errors are rendered.
See if you can spot something else.