Jump to content


Photo

Reading into an editable text field


  • Please log in to reply
2 replies to this topic

#1 munchy

munchy
  • Members
  • Pip
  • Newbie
  • 2 posts
  • LocationPhiladelphia, PA

Posted 30 September 2006 - 12:31 AM

Hello!

I am a teacher building a website to help students with their math work. Right now I am making the communication page where I post homework, test dates and the like. These are MYSQL database fields that I am trying to update using a web form so I do not have to go into phpmysqladmin and update each field by hand. I am hitting a brick wall with the script. I can make a form that updates these fields, but some fields I just want to stay as is. Is it possible to make some code to read the already-existing comments into an editable text field, so that I can make changes to the ones I need to change and then submit the form? All I would need help with is the part that reads the text into the text field, I can handle everything else (I'm pretty sure...)

Thanks,
Munchy

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 30 September 2006 - 01:03 AM

// connect and query your database.
// returning an array of records called $row.
echo "<form>";
echo "<textarea name=\"edit\">{$row['fieldtoedit']}</textarea>";
echo "</form>";


#3 munchy

munchy
  • Members
  • Pip
  • Newbie
  • 2 posts
  • LocationPhiladelphia, PA

Posted 30 September 2006 - 03:09 AM

Thanks Thorpe! I'll give that a try!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users