Copy link to clipboard
Copied
Good Day,
I have these two table, a user table which hold a user info, and then a friends table which will hold 2 user IDS. But I do not think I have it set up right, as I can not get to the data in the friends table.
Please advise on how to do this.
Many thanks.
<cfcomponent hint="I hold the general info" output="false" persistent="true">
<cfproperty name="GenInfoID" hint="The id for the " type="numeric" fieldtype="id" datatype="integer" generator="identity">
<cfproperty name="Name" hint="name of the " type="string" length="255">
<cfproperty name="UserID" singularname="UserID" fieldtype="one-to-many" cfc="KnownAssociates" fkcolumn="GenInfoID"/>
<cfproperty name="KnownAssociate2" singularname="KnownAssociate2" fieldtype="one-to-many" cfc="KnownAssociates" fkcolumn="GenInfoID"/>
</cfcomponent>
<cfcomponent persistent="true">
<cfproperty name="KnownAssociatesID" hint="The id for the Known Associates" type="numeric" fieldtype="id" datatype="integer" generator="identity">
<cfproperty name="GenInfoID" singularname="GenInfoID" fieldtype="many-to-one" cfc="GenInfo" fkcolumn="GenInfoID"/>
<cfproperty name="GenInfoID2" singularname="GenInfoID2" fieldtype="many-to-one" cfc="GenInfo" fkcolumn="GenInfoID2"/>
</cfcomponent>
Copy link to clipboard
Copied
Hi,
Can't get your actual requirement. Can you please provide more inputs?.
Copy link to clipboard
Copied
Hey thanks,
So you have a user who has a friend, so in the friend tbl I want to put a ID field, the user, and the user friend ID. Now the friend is just another record in the user tbl.
So I am not sure I built the table right, and then how to CRUD that data.
Thanks for the help,
Darrin
Copy link to clipboard
Copied
Hi Darrin,
I presume, you are trying to select users who are presented in user as well as friends tables before doing your CRUD.
Correct me if I am wrong.
Copy link to clipboard
Copied
So in the friends table, I have my ID and your ID.
and when I pull my page up, I should be able to get your name
But I do not think I built the tables right, I am new to CF ORM and havinf some issues with stuff like this
In the end I would like to be able to pull a user up and see every friend, no matter which col in the friends tbl
if that makes sense
Thanks again,
Darrin
Find more inspiration, events, and resources on the new Adobe Community
Explore Now