b@s
|
| Posted: 05/04/2002, 5:25 PM |
|
Can some one tell me what is wrong with this insert? I am puttin git in the Form properties After Insert
cn.execute ("insert into Usuarios (Username, Pwd, IDCliente, Nivel, Nombre) values ('" & tosql(fldU, "Text") & "', '" & tosql(fldP, "Text") & "', '" & tosql(fldIDdelCliente, "Number") & "', 1 ,'" & tosql(fldNombre, "Text") & "')")
how else could I do this?
thanks
|
|
|
 |
Ken Hardwick
|
| Posted: 05/05/2002, 1:43 AM |
|
The "ToSQL" function puts in the single quotes as needed...so I have removed
the extra ones...
cn.execute ("insert into Usuarios (Username, Pwd, IDCliente, Nivel, Nombre) values (" & tosql(fldU, "Text") & "," & tosql(fldP, "Text") & "," & tosql(fldIDdelCliente, "Number") & ", 1 ," & tosql(fldNombre, "Text") & ")")
|
|
|
 |
Ed Yin
|
| Posted: 11/25/2002, 12:34 PM |
|
It seems to me that codecharge gives unnecesary error messages.
The sql code i puted in from the back (vi editor on linx) is accepted and works fine. The same sql gives parsing erros wehn put in on a after update event ?
strange ... am i missing something maybe some nice practicle examples in codecharge
//-------------------------------
// Build base SQL statement
//-------------------------------
$sSQL = "select p.Clanname as p_Clanname, " .
// Parse Navigator
if(!$bEof && $iPage == 1)
$tpl->set_var("Vrije_serversNavigator", "");
else
{
}
if ($iSort == 1) $sOrder = " order by p.Clanname" . $sDirection;
if ($iSort == 2) $sOrder = " order by p.Server" . $sDirection;
if ($iSort == 3) $sOrder = " order by p.Enddate" . $sDirection;
}
}
else
{
$tpl->set_var("Form_Sorting", $iSort);
$sDirection = " ASC";
$sSortParams = "FormVrije_servers_Sorting=" . $iSort . "&FormVrije_servers_Sorted=" . "&";
}
if ($iSort == 1) $sOrder = " order by p.Clanname" . $sDirection;
if ($iSort == 2) $sOrder = " order by p.Server" . $sDirection;
if ($iSort == 3) $sOrder = " order by p.Enddate" . $sDirection;
}
//-------------------------------
// Build base SQL statement
//-------------------------------
$sSQL = "select p.Clanname as p_Clanname, " .
"p.Email as p_Email, " .
"p.Enddate as p_Enddate, " .
"p.Id as p_Id, " .
"p.PayedTill as p_PayedTill, " .
"p.Server as p_Server, " .
"p.ServerId as p_ServerId, " .
"p.ServerType as p_ServerType, " .
"p.players as p_players " .
" from paytable p ";
$sSQL .=" where p.Enddate !='0000-00-00'
or p.Id = 0";
//-------------------------------
the last line will be changed by codecharge in
"where p.Enddate =p2.Id "
strange, very strange
it would be nice to devolope some procedures for automatic sqls on moving,updating or inserting data too other tables.
|
|
|
 |
|