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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.