Code Comments
Programming Forum and web based access to our favorite programming groups.Another beginner's question here.
I'm trying to write a record update routine for a database which I've
created and everything seems fine except that the record changes aren't
being written. There are no error messages though and everything seems
to have worked except the record remains the same.
An initial screen asks for a record number (the primary key) which then
retrieves the record in question and displays it in a form on screen
allowing for any fields to be changed. This then calls a php script
which retrieves the values of the fields as follows:
<?php
$rec_no=$_POST['rec_no'];
$piece_no=$_POST['piece_no'];
$folio=$_POST['folio'];
$reg_dist=$_POST['reg_dist'];
$enum_dist=$_POST['enum_dist'];
$house=$_POST['house'];
$address=$_POST['address'];
$forename=$_POST['forename'];
$surname=$_POST['surname'];
$age=$_POST['age'];
$user=$_POST['user'];
$date=$_POST['date'];
$time=$_POST['time'];
I know this bit is working because I got the php script to display the
values before attempting the update.
Then I am calling the UPDATE as follows:
mysql_query(" UPDATE census_recs
SET rec_no='$rec_no', piece_no='$piece_no', folio='$folio',
reg_dist='$reg_dist', enum_dist='$enum_dist', house='$house',
address='$address', forename='$forename', surname='$surname',
age='$age', user='$user', date='$date', time='$time', WHERE
rec_no='$rec_no'");
This generates no errors but also does not update the record.
Can anyone suggest what might be wrong or is there anything I can do to
get the update routine to provide error messages?
Thanks in advance.
Ian
Post Follow-up to this message> BTW, what happens if surname is O'Hara? That depends on magic_quotes_gpc, magic_quotes_sybase etc. (which I personally dislike). Hilarion
Post Follow-up to this message*** Ian wrote/escribió (Wed, 15 Dec 2004 02:24:41 GMT): > Please ignore, now fixed. :-) BTW, what happens if surname is O'Hara? -- -- Álvaro G. Vicario - Burgos, Spain -- Thank you for not e-mailing me your questions --
Post Follow-up to this message> BTW, what happens if surname is O'Hara? That depends on magic_quotes_gpc, magic_quotes_sybase etc. (which I personally dislike). Hilarion
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.