 |
| Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more. |
|
 |
07-01-2009, 06:28 AM
|
#1 (permalink)
|
|
Member
Join Date: 12-19-08
Posts: 37
Latest Blog: None
|
Mysql query browser drop list
ok i have 2 tables in my database, table 1 and table 2.
In table 1 i have a column that in each row has a different word
Now in table 2 i want to be able to have a column where by when i go to enter data i am given the option of selecting words from a drop down menu, this list is is retrieving its data from the column data from table 1.
remember my question is about how to do this in mysql query browser.
i have done this in ms access but do not know how in mysql query browser.
|
|
|
07-01-2009, 02:18 PM
|
#2 (permalink)
|
|
Meeow!
Join Date: 04-13-07
Location: Romania
Posts: 3,235
Latest Blog: None
|
I'm not sure you can do that in mysql...I could be wrong though...I'm no db expert.
__________________
...to be continued
|
|
|
07-01-2009, 03:27 PM
|
#3 (permalink)
|
|
Member
Join Date: 12-19-08
Posts: 37
Latest Blog: None
|
Quote:
Originally Posted by Costin Trifan
I'm not sure you can do that in mysql...I could be wrong though...I'm no db expert.
|
what do you think the best way is to get this done?
Create a form in php? (which i havnt done before  )
|
|
|
07-01-2009, 05:09 PM
|
#4 (permalink)
|
|
Contributing Member
Join Date: 06-25-09
Location: Brighton, UK
Posts: 113
|
It's actually fairly easy to do in PHP, start with something like this and see how you do.
|
|
|
07-02-2009, 02:34 AM
|
#5 (permalink)
|
|
Meeow!
Join Date: 04-13-07
Location: Romania
Posts: 3,235
Latest Blog: None
|
Quote:
Originally Posted by RyOn
ok i have 2 tables in my database, table 1 and table 2.
In table 1 i have a column that in each row has a different word
Now in table 2 i want to be able to have a column where by when i go to enter data i am given the option of selecting words from a drop down menu, this list is is retrieving its data from the column data from table 1.
remember my question is about how to do this in mysql query browser.
i have done this in ms access but do not know how in mysql query browser.
|
Maybe I didn't understand you correctly, but you want to display the content of one table into another table's column as a dropdown list in your mysql client, like PhpMyAdmin or SQLYog and not in a php page, right? (please clarify)
because my answer was related to the first part and not the second like kieransimkin pointed out.
__________________
...to be continued
|
|
|
07-02-2009, 06:35 AM
|
#6 (permalink)
|
|
Member
Join Date: 12-19-08
Posts: 37
Latest Blog: None
|
Quote:
Originally Posted by Costin Trifan
Maybe I didn't understand you correctly, but you want to display the content of one table into another table's column as a dropdown list in your mysql client, like PhpMyAdmin or SQLYog and not in a php page, right? (please clarify)
because my answer was related to the first part and not the second like kieransimkin pointed out.
|
Yeah original question was just to see if i could create a droplist in mysql query browser, but if you don't think that is possible then how could i manipulate the data in the column the same way, php?
so yea you did answer my 1st question costin
and thanks kieransimkin, im looking into the tut on the link.
|
|
|
07-02-2009, 07:31 AM
|
#7 (permalink)
|
|
Moderator
Join Date: 01-23-07
Location: Buenos Aires, Argentina
Posts: 1,254
|
MySQL (as any DB engine) was designed to interact with applications.
Query Browser, however it's a utility, and its purpose is to help you maintaining and doing administration stuff on the database. You don't do data entry from Query Browser, for that purpose you should either:
1-download an application that allows you to connect to MySQL and do data entry.
2-or develop an application that allows you to connect to MySQL and do data entry.
I don't think there are any free data entry software that you can download, but certainly it's very easy to develop in PHP following some tutorials.
-Mysql/php basics
-Using forms and databases
-Dynamic dropdown lists.
__________________
Hades,
Ancient god, King of the Nether World, and Guardian of the Dead.
...and on my free time I'm also a web developer, contact me if you need one!
|
|
|
07-08-2009, 05:07 AM
|
#8 (permalink)
|
|
Member
Join Date: 12-19-08
Posts: 37
Latest Blog: None
|
How do I create a database driven drop down form in php?
What would the code be?
I have been searching all over for a good code.
And have tried looking through all the tuts like in w3schools.
But i just cant seem to hack this one.
Would someone be able to give me a quick fix and post an example php code?
Regards
Ryan
|
|
|
07-08-2009, 07:31 AM
|
#9 (permalink)
|
|
v7n Mentor
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
|
This is common in Microsoft products and can be done in MSSQL, phpMyAdmin/MySQL it cannot though.
I have never used Query Browser, but it might do what you are looking for, as Hades said.
Your other option, as others have said, is to create a PHP application, which is very easy to do in this case.
--
To create a PHP app for something like this, you would need to create a connection to your database, get the data from the database (the words table), use that data to populate a select dropdown list, and then add another input for what you need to insert into the other table. From there, once the submit button is clicked, you would validate your data and then add it into the database.
Bam! You're done.
__________________
█ Izzmo
█ Coding Guru Extraordinaire
█ ZeroWeb Hosting & Design - Customizable hosting for every type of user!
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:59 PM.
© Copyright 2008 V7 Inc Powered by vBulletin Copyright © 2000-2009 Jelsoft Enterprises Limited.
|
|
|