Jump to content

Updating field


gavin.sibley

Recommended Posts

Hey,

 

im trying to fix a line of code that should update a field in the database when filled in. The code i think handles this is below.

 

<input type="text" id="uuser_address" name="uuser_address" value="<?php echo("$slide[address]"); ?>"><br /><input type="text" id="uuser_town" name="uuser_town" value="<?php echo("$slide[town]"); ?>"><br /><input type="text" id="uuser_county" name="uuser_county" value="<?php echo("$slide[county]"); ?>"><br /><input type="text" id="uuser_postcode" name="uuser_postcode" value="<?php echo("$slide[postcode]"); ?>"></div>

 

 

can anyone tell me why this is updating all the address fields other than the postcode?

 

thanks,

gavin

Link to comment
https://forums.phpfreaks.com/topic/259257-updating-field/
Share on other sites

ok, you've said that the code is updating all the fields in your database, but have not given the code which could feasibly do this.  It will be in your script as "UPDATE ****............................WHERE................"

 

Also, if you wrap your code in tags which are @[@code@] "code here" [@/code@]@ (remove the @ signs).

Once you've got the tags in place, put linebreaks in to make it easier to read, you may even spot a few errors youself.

 

eg

<input type="text" id="uuser_address" name="uuser_address" value="<?php echo("$slide[address]"); ?>">
<br />
<input type="text" id="uuser_town" name="uuser_town" value="<?php echo("$slide[town]"); ?>">
<br />
<input type="text" id="uuser_county" name="uuser_county" value="<?php echo("$slide[county]"); ?>">
<br />
<input type="text" id="uuser_postcode" name="uuser_postcode" value="<?php echo("$slide[postcode]"); ?>">
</div>

 

(wasn't that much more of a please to read!! lol)

 

 

Link to comment
https://forums.phpfreaks.com/topic/259257-updating-field/#findComment-1329027
Share on other sites

i think i have found it!

 

i found this in a different php script.

 

$query = mysql_query("UPDATE `temp_users` SET `book_stage` = '1', `title` = '$title',  `fname` = '$fname',  `lname` = '$lname',  `address` = '$address',  `town` = '$town',  `county` = '$county',  `postcode` = '$postcode',  `telephone` = '$telephone',  `email` = '$email',  `venue_name` = '$venue_name',  `venue_county` = '$venue_county',  `start_time` = '$start_time',  `end_time` = '$end_time',  `special_instructions` = '$special_instructions', `password` = '$password', `time_total` = '$time_total', `hrs` = '$hrs', `added_stamp` = '$timeme' WHERE `id` = '$temp[id]'");

 

hope this is the one!

 

thanks

 

Link to comment
https://forums.phpfreaks.com/topic/259257-updating-field/#findComment-1329036
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.