Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Creating form element from Database content
Old 05-25-2005, 10:34 AM Creating form element from Database content
Novice Talker

Posts: 11
Location: Sofia
Trades: 0
Hi
How can generate form elements(drop-down menu, check boxes and radiobutons etc.) from database content and enter the result of choises in other database table?
Thank you
Bimbas is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-25-2005, 10:37 AM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
To, generate form elements(drop-down menu, check boxes and radiobutons etc.) from database you use SELECT STATEMENT and to enter the result of choises in other database table? you use INSERT STATEMENT AND JOIN. if you know MySQL pretty well that will do the job.
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-25-2005, 10:44 AM
Novice Talker

Posts: 11
Location: Sofia
Trades: 0
Thanks for reply
I'm new in MySQL but I'll read about SELECT and INSERT statements
Bimbas is offline
Reply With Quote
View Public Profile
 
Old 05-25-2005, 12:17 PM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Remember to learn about JOIN
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 06-01-2005, 09:27 PM
Novice Talker

Posts: 9
Trades: 0
I am trying to do the same thing. I'd really appreciate some help with making the SQL statement. I'm just not sure what it shoud look like. SELCT what from where, Insert and join it with what??
Funky Monk is offline
Reply With Quote
View Public Profile Visit Funky Monk's homepage!
 
Old 06-02-2005, 04:25 AM
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
SELECT statement:

PHP Code:
$result mysql_query("SELECT * FROM table_name WHERE condition='$condition'"); 
That statement will pull all the data from the database table with the conditions specified.

PHP Code:
$result_array mysql_fetch_array($result); 
This will put the row in an array and you can access each field individually
(e.g. $name = $result_array['name']


To INSERT the data back into the table use this code:

PHP Code:
$query "INSERT INTO table_name( field1, field2, field3)
        values( '
$field1, '$field2, '$field3')";
                    
    
mysql_query($query$link)
    or die(
"Couldn't add data to \"table_name\" table: "
    
.mysql_error() );

    
mysql_close ($link); 

I dont know about the JOIN statement but im sure someone here will...


Hope this helps
Stoot
stoot98 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Creating form element from Database content
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22560 seconds with 12 queries