CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Update a database field

Print topic Send  topic

Author Message
kriska

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

hi all,
i need to update the database field in my messaging system, there is a field called draft in the message table. i need tjo update the field to 1only if the user click the add_to _draft button .
if the user click the send(submit ) button user no need to update the data field draft in the database.

in order to do that i added a button called add_to_draft to the compose mail record builder table and add the code written bellow to before show event.but it give the error . i dont know how to get the message id because the message also added to the database when the user click this add_to_draft button.
please anyone help me on this matter.
global $DBConnection1;
$SQL ="update messages set status = 1 where msg_id = ".mysql_insert_id();
$DBConnection1->query($SQL);
$DBConnection1->close();
View profile  Send private message
damian

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

i think you are over complicating it....
add your checkbox and if ticked set value to "1"
then all messages where status = 1 are draft
let ccs do the work for you - you dont need any custom coding...

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

Posts: 18
Posted: 12/02/2009, 3:37 AM

thanks for the reply
i'll try it
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.