List:General Discussion« Previous MessageNext Message »
From:Nicolas Verhaeghe Date:April 21 2006 5:39am
Subject:RE: Form value editing
View as plain text  
can someone please just send me or post a example of editing feilds of a 
mysql database within an html form and then updating the values thanks alot
   here is a small database u can use i can expand on your example as needed

  `id` int(10) NOT NULL auto_increment,
  `first_name` varchar(30) NOT NULL default '',
  `last_name` varchar(50) NOT NULL default '',
  `email` varchar(75) default NULL,
  `contact_status` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)

    add form i have working and SQL stuff i have its just bringing up a 
form from a list and editing values in the form i need help with ,, thanks
here is a form i have thats about all i have

      <table width="400" align="center" border="0" cellspacing="0" 
         <td colspan="2" align="center" style="font-size:18px; 
font-weight:bold;">Manage Contact's Data Form</td>
         <input type="hidden" value="<?php echo $id?>" name="id">
       <td> </td>
       <td> </td>
       <td align="right">First Name: </td>
       <td><input name="first_name" type="text" value="<?php echo 
$first_name?>"> </td>
      <td align="right">Last Name: </td>
      <td><input name="last_name" type="text" value="<?php echo 
$last_name?>"> </td>
       <td align="right">Email Address: </td>
       <td><input name="email" type="text" value="<?php echo $email?>"> 
       <td align="right">Stop Contact? </td>
       <td><input name="status" type="checkbox" value="1" <?php if 
($status==1){ echo " checked=CHECKED "; } ?>> </td>
       <td> </td>
       <td> </td>
       <td colspan="2" align="center"><input name="submit" type="submit" 
value="<?php echo $value?>"> <input name="reset" type="reset" 
value="Clear Form"></td>


If you can't use a stored procedure, create a dynamic "UPDATE" statement and
execute it.

Make sure you take care of the single-quotes, for if you do not have magic
quotes enabled (I am one of those who never activate them), you need to use
the addslashes function to transform ' into ''.

Think about data types and field length and you should be fine.

Now, if you want me to do it for you, don't forget to give me a piece of
your cake.

Form value editingBrian E Boothe20 Apr
  • Re: Form value editingPeter Brawley20 Apr
  • RE: Form value editingfbsd21 Apr
    • RE: Form value editingPat Adams21 Apr
  • RE: Form value editingNicolas Verhaeghe21 Apr
RE: Form value editingJay Blanchard20 Apr