Khong Biet
|
Posted: 07/23/2004, 4:33 AM |
|
Plaese help me to fix bug.
I create Editable grid with some row query from Localhost server and set tinh_trang == 1 and submit
When submit I read all data of row have tinh_trang==1 to Insert to server so in Event Affter update look like:
if ($vb_den->tinh_trang->GetValue() == 1)
{
$SQL = "INSERT INTO vb_den ("
. "so_kh, "
. "trich_yeu, "
. "loai_vb, "
. "noi_gui, "
. "ngay_ky, "
. "nguoi_ky, "
. "tinh_trang"
. ") VALUES ("
. $db->ToSQL($vb_den->so_kh->GetDBValue(), $vb_den->so_kh->DataType) .", "
. $db->ToSQL($vb_den->trich_yeu->GetDBValue(), $vb_den->trich_yeu->DataType) .", "
. $db->ToSQL($vb_den->loai_vb->GetDBValue(), $vb_den->loai_vb->DataType) .", "
. $db->ToSQL($vb_den->noi_gui->GetDBValue(), $vb_den->noi_gui->DataType) .", "
. $db->ToSQL($vb_den->ngay_ky->GetDBValue(), $vb_den->ngay_ky->DataType) .", "
. $db->ToSQL($vb_den->nguoi_ky->GetDBValue(), $vb_den->nguoi_ky->DataType) .","
. ")";
$db = new clsDBConnection2();
$db->query($SQL);
$db->close();
}
But it run and give me error : Fatal error: Call to a member function on a non-object in (. $db->ToSQL($vb_den->so_kh->GetDBValue(), $vb_den->so_kh->DataType) .", " ...)
Can you point me in the right direction to fix bug
Best regards
|
|
|
Last Hero
|
Posted: 07/23/2004, 7:45 AM |
|
Try move "$db = new clsDBConnection2();" before "$SQL = ...."
:)
|
|
|
|