SunQuest
           PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 14th, 2002, 03:30 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
from db

Hello

I have a php form where there are some form fields(text boxes) displyed in it.Now, i want those boxes to be filled with values from my database.How should i proceed?

thank you

Reply With Quote
  #2  
Old June 14th, 2002, 03:48 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: from db

php Code:
Original - php Code
  1. <?
  2. $query = "SELECT textfield1,textfield2 FROM table WHERE something=somethingelse";
  3. $result = mysql_query($query);
  4. $row = mysql_fetch_array($result);
  5. echo "<FORM action="somescript.php" METHOD="POST">n";
  6. echo "<INPUT type="text" size="20" name="textbox1" value="".$row['textfield1'].""><BR>n";
  7. echo "<INPUT type="text" size="20" name="textbox2" value="".$row['textfield2'].""><BR>n";
  8. echo "<INPUT type="submit" name="submit" value="Submit!"><BR>n";
  9. echo "</FORM>n";
  10. ?>

Reply With Quote
  #3  
Old June 14th, 2002, 07:18 PM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: from db

um, make a habit of using htmlspecialchars() when putting values directly from the db to a form. This way "'s will be shown in it's entity form (") but most browsers interpret it properly.. Else you'll find the value cuts short and you'll struggle to find out why..

2c *ching-ching*.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > from db


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway