defroster Posted July 25, 2010 Share Posted July 25, 2010 Hello, I have sat for hours now with this code. It runs without errors but will not update the changes in the database. What am I doing wrong? I am a beginner at this. Thanks a million /df <?php session_start(); require ("incl/config.php"); require ("incl/functions.php"); //Admin stuff Users.Setting=1 if($_SESSION['setting'] == 1) { $db = mysql_connect($dbhost, $dbuser, $dbpassword); mysql_select_db($dbdatabase, $db); $id=$_POST['id']; $title=$_POST['title']; $titletext=$_POST['titletext']; $url=$_POST['url']; $dateposted=$_POST['dateposted']; // To protect MySQL injection $title = stripslashes($title); $titletext = stripslashes($titletext); $url = stripslashes($url); $dateposted = stripslashes($dateposted); $title = mysql_real_escape_string($title); $titletext = mysql_real_escape_string($titletext); $url = mysql_real_escape_string($url); $dateposted = mysql_real_escape_string($dateposted); mysql_query("UPDATE Videos SET title='$title', titletext='$titletext', url='$url', dateposted='$dateposted' WHERE id='$id'"); echo mysql_error(); } ?> Link to comment https://forums.phpfreaks.com/topic/208798-php-sql-update-question/ Share on other sites More sharing options...
defroster Posted July 25, 2010 Author Share Posted July 25, 2010 I found the problem. Thanks all anyway. I hade several forms on the same page and the form below were sending the parameters. Problem solved. Good night Link to comment https://forums.phpfreaks.com/topic/208798-php-sql-update-question/#findComment-1090788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.