Forum Moderators: coopster
$dateReg = $_POST['dateReg'];
$name = $_POST['name'];
$fatherN = $_POST['fatherN'];
$sex = $_POST['sex'];
$age = $_POST['age'];
$address = $_POST['address'];
$phone = $_POST['phone'];
$dateAttStar = $_POST['dateAttStar'];
$attCat = $_POST['attCat'];
$diseaseClass = $_POST['diseaseClass'];
$site = $_POST['site'];
$type = $_POST['type'];
$weight0 = $_POST['weight0'];
$sp0 = $_POST['sp0'];
$sp0Date = $_POST['sp0Date'];
$sp0Lab = $_POST['sp0Lab'];
$cs1 = $_POST['cs1'];
$dateStop = $_POST['dateStop'];
$patientIs = $_POST['patientIs'];
$remarks = $_POST['remarks'];
$query = "INSERT INTO register SET dateReg='$dateReg', name='$name', fatherN='$fatherN', sex='$sex', age='$age', address='$address', phone='$phone', dateAttStar='$dateAttStar', attCat='$attCat', diseaseClass='$diseaseClass', site='$site', type='$type', weight0='$weight0', sp0='$sp0', sp0Date='$sp0Date', sp0Lab='$sp0Lab', cs1='$cs1', dateStop='$dateStop', patientIs='$patientIs', remarks='$remarks'";
but the error is:
Incorrect date value: '' for column 'dateReg' at row 1
the date value i am inserting is 2006-02-01 which is the correct date format for mysql, any one can help please?
[edited by: jatar_k at 6:30 pm (utc) on July 2, 2006]
[edit reason] fixed sidescroll [/edit]
btw. never saw the insert syntax you used .. wouldn't you usually use
INSERT INTO mytab (field1, field2,....) VALUES ('val1', 'val2', ...)?
I tried yours and it worked, but it looks like a mixture of INSERT and UPDATE?