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();
|
 |
 |
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.... :)
|
 |
 |
kriska
Posts: 18
|
| Posted: 12/02/2009, 3:37 AM |
|
thanks for the reply
i'll try it
|
 |
 |
|