CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 insert the values to the database using hidden text boxes

Print topic Send  topic

Author Message
kriska

Posts: 18
Posted: 11/27/2009, 2:38 AM

hi all,

I'm new to the code charge so i dont know much about the soft ware.
I'm trying to create a messaging system inside a site. so i just want to pass the user it to the message table which i created to store the message data in the messaging system.
i used the msg_to_name to enter the user name and it contains the aurocomplete feature. i just need to insert the msg_to_id which is the user id of the receiver. so i try to insert a hidden text box to do that. but i was failed. so any one can help me on this matter.
I got another problem also. i just need to add the compose mail data to the draft table when user click a button(named as add to draft). so there on the button oncllick evernt i used

$db = new clsDBConnection1();
$SQL = "INSERT INTO draft (msg_to_name,msg_title,msg_body,msg_from_name,msg_id) ".
"VALUES (". $db->ToSQL(CCGetFromGet("msg_to_name",0),ccsInteger) .",". $db->ToSQL(CCGetFromGet("msg_title",0),ccsInteger) .",". $db->ToSQL(CCGetFromGet("msg_body",0),ccsInteger) .",". $db->ToSQL(CCGetFromGet("msg_from_name",0),ccsInteger) .",". $db->ToSQL(CCGetUserID(),ccsInteger) .")";

but it doesnt work.
could you please anyone can help me on this matter.
thank you

regards
kriska
View profile  Send private message
damian

Posts: 838
Posted: 11/28/2009, 2:52 AM

i think you shoudl *really* do the tutorials and try the sample packs... things will be so much clearer...

to store the UserID in your hidden field add custom code on before show of your hidden field and use something like:
$Component->SetValue(CCGetUserID());

to insert your whole form into the database - let ccs do it for you.

and CCGetFromGet() is used to get a parameter from the url... see the help:
Retrieves a value of the GET input parameter. The function first attempts to retrieve the   
parameter from the GET query string and if no value is returned the function returns the default   
value specified in the function call. 

do the tutorials.... invest 2-4 hours of your life and get them back in a couple of days...

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
kriska

Posts: 18
Posted: 11/29/2009, 8:27 PM

dear damian,
Thank you very much for the reply !
I used the CCGetUserID() to get the user id of the login person thats working fine. what i need is to get the user in of the receiver not the sender. i can use the CCGetUserID() to get the senders userid.

what i need is to get the receiver's user id when i type the receivers name.




View profile  Send private message
damian

Posts: 838
Posted: 11/29/2009, 8:59 PM

Quote kriska:
dear damian,
Thank you very much for the reply !
I used the CCGetUserID() to get the user id of the login person thats working fine. what i need is to get the user in of the receiver not the sender. i can use the CCGetUserID() to get the senders userid.
what i need is to get the receiver's user id when i type the receivers name.

typically you would click on a link (eg the persons nickname) to send them a message and this would then be easy to get the id... if they are typing it in you could use an ajax query or you could use CCDLookUp to query the database...

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
damian

Posts: 838
Posted: 11/29/2009, 9:00 PM

or a DLookUp....
_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
kriska

Posts: 18
Posted: 11/30/2009, 1:42 AM

Quote damian:
or a DLookUp....

i try to use CCDLookUp there I set
Expression " * "
Domain "users"
Criteria "user_login={msg_to_name}"
convert result to Integer
Type of target Control
Target Hidden1
but it seems not working.

information- user in the database table containing the information about the users in the system (user_login, user_id)
{msg_to_name} is the name of the text box which is allow to enter the name.
View profile  Send private message
kriska

Posts: 18
Posted: 11/30/2009, 2:09 AM

Quote damian:
i think you shoudl *really* do the tutorials and try the sample packs... things will be so much clearer...
do the tutorials.... invest 2-4 hours of your life and get them back in a couple of days...


could you please where is the tutorials. i have go through some of the parts in QuickStartTutorials.pdf
thank you
View profile  Send private message
damian

Posts: 838
Posted: 12/01/2009, 4:54 AM

file -> new -> project -> second tab -> example pack

http://support.yessoftware.com/tutorials.asp

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.