zeeshan_haider000 Posted February 14, 2010 Share Posted February 14, 2010 Is it possible to have like "subfields" in mysql? I mean if I have a field, let's say a field named Fieldy, could I create sub fields under "Fieldy" using PHP? Ex: Fieldy (Parent field) -Child Field 1 -Child Field 2 -ETC Field I want to this so that I could be able to edit parts of a data without altering the whole thing. How would I do this? Or any alternative? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/192079-is-it-possible-to-create-subfields-in-mysql-database/ Share on other sites More sharing options...
zeeshan_haider000 Posted February 15, 2010 Author Share Posted February 15, 2010 Yes? No? lol Quote Link to comment https://forums.phpfreaks.com/topic/192079-is-it-possible-to-create-subfields-in-mysql-database/#findComment-1012363 Share on other sites More sharing options...
kickstart Posted February 15, 2010 Share Posted February 15, 2010 Hi Not really no. You could play around using substr to manipulate parts of the string field Fieldy, or hive the sub fields off into a seperate table. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/192079-is-it-possible-to-create-subfields-in-mysql-database/#findComment-1012483 Share on other sites More sharing options...
jay7981 Posted February 16, 2010 Share Posted February 16, 2010 you could do as kickstart stated by doing this table1 id field1 field2..... table2 id field1.2 field2.1... and use INNER/OUTER JOIN to link the 2 together. see here for explanation of JOINS Quote Link to comment https://forums.phpfreaks.com/topic/192079-is-it-possible-to-create-subfields-in-mysql-database/#findComment-1012962 Share on other sites More sharing options...
zeeshan_haider000 Posted February 16, 2010 Author Share Posted February 16, 2010 @Kickstars Thanks for answering @Jay, thank you too for answering. Yupe that's what I did, I didn't want to create a separate table, but with no options left, I had to. Quote Link to comment https://forums.phpfreaks.com/topic/192079-is-it-possible-to-create-subfields-in-mysql-database/#findComment-1013245 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.