having problems getting this to update my table in my mysql DB… i looked it over and over but i can figure out what im doing wrong… any help would be great :’(
[php]<?php
// This file is www.developphp.com curriculum material
// Written by Adam Khoury January 01, 2011
// http://www.youtube.com/view_play_list?p=442E340A42191003
// Script Error Reporting
error_reporting(E_ALL);
ini_set(‘display_errors’, ‘1’);
?>
<?php
// Include config file
include "config.php";
// If form button has been pressed then do the following
if(isset($_POST['update'])){
// Get id of post
$id = $_GET['id'];
$lname = $_POST['lname'];
$laddress = $_POST['laddress'];
$lcity = $_POST['lcity'];
$lstate = $_POST['lstate'];
$lzip = $_POST['lzip'];
$Mname = $_POST['Mname'];
$maddress = $_POST['maddress'];
$mcity = $_POST['mcity'];
$mstate = $_POST['mstate'];
$mzip = $_POST['mzip'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
// Update database table
$query = "UPDATE Contactinfo SET lname = '$lname', laddress = '$laddress', lcity = '$lcity', lstate =$'lstate', lzip ='$lzip', Mname ='$Mname', maddress = '$maddress', mcity ='$mcity', mstate = '$mstate', mzip ='$mzip', phone = '$phone', fax ='$fax', email1 ='$email1', email2 ='$email2' WHERE id = 'id' LIMIT 1";
$result = mysql_query($query);
if ($result){
echo "Successfully edited entry";
} else {
echo "There was error editing entry";
}
}
?>[/php]