Friday 15 July 2011

mysql - Personalized Welcome Messages -


How do I create a welcome message on my home page with that user's name?

The Dynamic Drag Recordset field does not work on my page:

  & lt; Cfoutput & gt; # Recorsetset1 User Name # & lt; / Cfoutput & gt;  

This is using the first username in the table, as a user I am not logged in. Do I have to add something in my application? CFC page?

Note: If you show all the code (how you enter How do you ask for datasets?), It will help us assist you.

A few very common advice for now.

The reason for this is that all of you (Or at least more than one) records when you only show the first record from the output once the CF dataset, you can see it by looping on the dataset Are:

    # Recordset # Username # & lt; / cfoutput & gt; & lt  

It should show all your records.

As Jason has told you to give your user Only one record should be selected. When you login, save the user # (usually the primary key, id) in session scope (say, in session.userid ) and later this Use it in a variety of questions Switch to (I do not know your query, so it is just to show the idea):

  & lt; Cfquery data-sensor = "datasetname" name = "recordset 1" & gt; Select user by user name where id = & lt; Cfqueryparam cfsqltype = "cf_sql_integer" value = "# session.userid #" /> & Lt; / Cfquery & gt;  

Understand that if you have unique ID as PK, then you will get only one record in Records 1, so your initial output will show the correct username.


No comments:

Post a Comment