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

 Listbox - multiple select

Print topic Send  topic

Author Message
Raji
Posted: 03/31/2005, 2:33 AM

This is my coding for multiple select:

$DBfirdausnet

$NewConn = null;
$Userlist = array();
$UserID = "";
$temp = 0;

$NewConn = new clsDBfirdausnet();
$NewConn1 = new clsDBfirdausnet();

$SQL = "SELECT id_surat FROM tindakan_surat";
$NewConn1->query($SQL);
$Result = $NewConn1->next_record();

while ($Result) {
$IDSurat = $NewConn1->f("id_surat");

if($IDSurat > $temp)
{
$temp = $IDSurat;
}

$Result = $NewConn1->next_record();
}

$CurrSuratID = $temp;
$UserList = CCGetFromPost("TextBox2",array());
$UserList1 = CCGetFromPost("TextBox1",array());
$UserList2 = CCGetFromPost("kandungan",array());
$UserList3 = CCGetFromPost("b_status",array());
$UserList4 = CCGetFromPost("arahan",array());
$UserList5 = CCGetFromPost("TextBox7", array());
$UserList6 = CCGetFromPost("TextBox8",array());

reset($UserList);
while(list($key,$UserID)= each($UserList)){
$NewConn1->query("INSERT INTO tindakan_surat(id_surat,id_penerima,id_pengguna,kandungan_baru,status_tindakan,arahan_keluar,tarikh_rekod,tarikh_akhir) VALUES (".
$NewConn1->ToSQL($CurrSuratID,ccsInteger).",".
$NewConn1->ToSQL($UserID,ccsInteger).",".
$NewConn1->ToSQL($UserList1,ccsInteger).",".
$NewConn1->ToSQL($UserList2,ccsText).",".
$NewConn1->ToSQL($UserList3,ccsText).",".
$NewConn1->ToSQL($UserList4,ccsText).",".
$NewConn1->ToSQL($UserList5,ccsDate).",".
$NewConn1->ToSQL($UserList6,ccsDate).")");
}


But I'm still having some probs. It is adding to database but ....look at the following database:

330
NULL
NULL
NULL
Sudah diambil tindakan
NULL
hkkhjkhjk
2005-03-31
2005-03-31
0



331
3
5
FileUpload2690831180629
Sudah diambil tindakan
NULL
hkkhjkhjk
2031-03-20
2031-03-20
5

The 1st one brings all NULL values but the dates are new dates.

The 2nd one brings all the values but the dates are old dates.

I really dont understand why...is it my programming error or the setting probs....

Am i need to pu array for dates....and how abt if i wanna do validation for date.....wht is the validation rule for dates....
anyone could help me on...thank u

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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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