i've been looking @ last hour , cannot see why wont work? carried out in bootstrap modal via ajax.
for reason supplierupdate not updated in database. (it timestamp)
$conn = new pdo("mysql:host=$hostname; dbname=$username;charset=utf8", $username, $password, array(pdo::mysql_attr_init_command => "set names 'utf8'")); // set pdo error mode exception $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); $sql = "update suppliers set updatetime=:updatetime, code1=:code1, code1desc=:code1desc, code2=:code2, code2desc=:code2desc, code3=:code3, code3desc=:code3desc userid ='$userid'"; $stmt = $conn->prepare($sql); $stmt->bindparam(':code1', $_post['code1'], pdo::param_str); $stmt->bindparam(':code1desc', $_post['code1desc'], pdo::param_str); $stmt->bindparam(':code2', $_post['code2'], pdo::param_str); $stmt->bindparam(':code2desc', $_post['code2desc'], pdo::param_str); $stmt->bindparam(':code3', $_post['code3'], pdo::param_str); $stmt->bindparam(':code3desc', $_post['code3desc'], pdo::param_str); $stmt->bindparam(':updatetime', $_post['update'], pdo::param_str); $stmt->execute(); <input type="text" name="supplierupdate" id="supplierupdate" value="<?php echo $timestamp ?>">
your input type name="supplierupdate" dont see binding name using $_post['update']
Comments
Post a Comment