Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / September 2004



Tip: Looking for answers? Try searching our database.

Need help with this search form...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TylerStonestreet - 29 Sep 2004 19:54 GMT
i have..

Search for Account:<br><br>
<form name="changeUser" action="viewaccountformresults.cfm" method="post">
Search By Username:
<input type="text" name="user_name">
<input type="Submit" value="Search!">
</form>

Search Results<br><br>
Here are your results from your search:<br></center>
<br>
<cfquery name="registration" datasource="userlogin">
SELECT *
FROM registration_info
where user_name Like '%#form.user_name#%'
</cfquery>
<cfoutput query="registration">
<li><a href="viewaccount.cfm?ID="#user_id#">#user_name#</a></li>
</cfoutput>

I dont think i did the link part right, as that is where i am stuck... and
also on the next page that actually shows the information and stuff for who
they were searching for.. how would i do that because they searched by
user_name, but user_Name is only in one table and i need information from all
tables.. they are all joined together by user_id but im dumb with tables
joins.. can someone help

<cfquery name="alignment" datasource="userlogin">
SELECT *
FROM alignment
where user_ID = '#URL.user_ID#'
</cfquery>
<cfoutput query="alignment">
w0lvie - 30 Sep 2004 21:49 GMT
Is this in an Access or SQL database?  If so, you could make a query and then
run your CF code against that query just like it was a table.. .that way, your
database handles all of the nasty join business for you... since all your
tables are related by the userid, it should just be a matter of making your
query (for access) or view (for sql) that contains all the tables you need to
pull information from.

As for the user_name part, I'm not sure what ya mean... do you want it to
output a link that is the users name?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.