Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problems with UPDATE
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



Report this thread to moderator Post Follow-up to this message
Old Post
Ian
12-17-04 01:55 AM


Re: Problems with UPDATE
> BTW, what happens if surname is O'Hara?

That depends on magic_quotes_gpc, magic_quotes_sybase etc. (which
I personally dislike).

Hilarion



Report this thread to moderator Post Follow-up to this message
Old Post
Hilarion
12-17-04 08:56 PM


Re: Problems with UPDATE
*** 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
--

Report this thread to moderator Post Follow-up to this message
Old Post
Alvaro G Vicario
12-21-04 08:55 AM


Re: Problems with UPDATE
> BTW, what happens if surname is O'Hara?

That depends on magic_quotes_gpc, magic_quotes_sybase etc. (which
I personally dislike).

Hilarion



Report this thread to moderator Post Follow-up to this message
Old Post
Hilarion
12-21-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:47 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.