|
Posted by Terry on 05/18/06 18:20
I have a form that my wife uses to update her tennis racket website. I
modified it to allow data entry, modify, and delete. If you enter an id
number you get the matching record if there is one. The data from that
record is now displayed in the form ready to change. The second submit
of the same id updates the record.
$description=$_POST['description'];
$grip=$_POST['grip']; // Sizes are in inches (")
if ($id) {
$query="SELECT * FROM `rackets` WHERE id=$id";
// Standard stuff here
if (($id)and($id==$oldid)) { //$oldid is a hidden input field
$row[3]=$description;
$row[4]=$grip;
}
<form>
<textarea id=\"description\" name=\"description\">$row[3]</textarea>
<label>Grip Sizes </label><input type=\"text\" id=\"grip\"
name=\"grip\" maxlength=\"60\" size=\"60\" value=\"$row[4]\">
[Submit]
</form>
$query="SELECT * FROM `rackets` WHERE 1 ORDER BY id DESC";
echo "All Records in a table for review" // Displays properly
$row[3] and [4] have escape characters \
-------------------
Added $row[3]=stripslashes($description);
$row[4]=stripslashes($grip);
$description will display whatever is entered ' and "
$grip will truncate anything after the " when the record comes up for
modification.
The only difference I can see is one is a textarea, the other an input box.
Any ideas welcomed (and thanks to anyone willing to wade through all
this stuff).
--
TK
http://www.wejuggle2.com/
Still Having a Ball
..
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Navigation:
[Reply to this message]
|