Ok masters, the last part of this mess. - this follows up to the poetry formattign thread some of you just replied to. After this, 99% of my questions are answered in previous threads. Just hope I can find my $#%@#$! book soon.
Now that the poetry is formatted, I have it so that only registered users can post. The poem adds, the data formats, but I want to add data from another table that I am querying. I'm guessing I can use CFSET again, but again, all syntax I try gives me mad errors. Here we go.
<cfquery name="search_db" datasource="db26401a" username="username" password="passwd" dbserver="localhost" dbname="dbname">
SELECT email, uname and pswd FROM users WHERE uname = '#form.uname#' AND pswd = '#form.pswd#'
</cfquery>
<CFIF #search_db.recordcount# is 1>
(authentication, it works fine, now I need the username and email posted in the next part)
<cfset form.data=replace(data, "#chr(13)##chr(10)#", "<br>", "all"
>
(data formatting - thanks Darkman!)
<cfquery name="db_insert" datasource="db26401a" username="username" password="passwd" dbserver="localhost" dbname="dbname">
INSERT INTO poetry (id, info, cpr, data, email) VALUES ('#form.id#', '#form.info#', '#form.cpr#', '#form.data#', '#form.name#')
</cfquery>
Now, how do I set 'name' and 'email' to be the uname and email variables from the search_db query?
Once again, I am in your debt.
Kelani
Now that the poetry is formatted, I have it so that only registered users can post. The poem adds, the data formats, but I want to add data from another table that I am querying. I'm guessing I can use CFSET again, but again, all syntax I try gives me mad errors. Here we go.
<cfquery name="search_db" datasource="db26401a" username="username" password="passwd" dbserver="localhost" dbname="dbname">
SELECT email, uname and pswd FROM users WHERE uname = '#form.uname#' AND pswd = '#form.pswd#'
</cfquery>
<CFIF #search_db.recordcount# is 1>
(authentication, it works fine, now I need the username and email posted in the next part)
<cfset form.data=replace(data, "#chr(13)##chr(10)#", "<br>", "all"
(data formatting - thanks Darkman!)
<cfquery name="db_insert" datasource="db26401a" username="username" password="passwd" dbserver="localhost" dbname="dbname">
INSERT INTO poetry (id, info, cpr, data, email) VALUES ('#form.id#', '#form.info#', '#form.cpr#', '#form.data#', '#form.name#')
</cfquery>
Now, how do I set 'name' and 'email' to be the uname and email variables from the search_db query?
Once again, I am in your debt.
Kelani