smfmetro10
asked on
how do i join three tables
Hi,
I have a query that has two joined tables but now I need to join another table with the ability to delete files.
Here is my code so far:
How do I join tblCandidatePortfolioProje ctLinks with column names of (link_id, req_part_id, text_title, description)
Thanks!
I have a query that has two joined tables but now I need to join another table with the ability to delete files.
Here is my code so far:
How do I join tblCandidatePortfolioProje
Thanks!
<cfquery name="qcheck" datasource="#APPLICATION.datasource#">
SELECT f.[file_id], f.extension, v.candidate_id
FROM tblCandidatePortfolioProjectFiles f
INNER JOIN vwCandidatePortfolioProjects v
ON f.req_part_id = v.req_part_id
AND v.submitted IS NULL
WHERE v.constitid = #SESSION.current_user.constitid# AND f.[file_id] = <cfqueryparam value="#Form.id#" cfsqltype="cf_sql_integer">
</cfquery>
<cfif qcheck.recordcount eq 1>
<cfset thisDir = "#APPLICATION.upload_dir##qcheck.candidate_id#">
<cffile action="delete" file="\#thisDir#\worksample_#qcheck.file_id#.#qcheck.extension#">
<cfif FileExists("\#thisDir#\worksample_T#qcheck.file_id#.#qcheck.extension#")>
<cffile action="delete" file="\#thisDir#\worksample_T#qcheck.file_id#.#qcheck.extension#">
</cfif>
<cfquery name="qdelete_files" datasource="#APPLICATION.datasource#">
DELETE FROM tblCandidatePortfolioProjectFiles where file_id = <cfqueryparam value="#id#" cfsqltype="cf_sql_integer">
</cfquery>
<cfelse>
Can not delete file
</cfif>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great thanks!
This doesn't really make sense... can you rephrase this please?
Keep in mind that you know your application, we don't know it at all... you have to be specific about what you want to do and to what..