function add_gl_account($account_code, $account_name, $account_type, $account_code2, $tax_code)
{
+ $account_name = db_escape($account_name);
$sql = "INSERT INTO ".TB_PREF."chart_master (account_code, account_code2, account_name, account_type,
tax_code)
VALUES ('$account_code', '$account_code2', '$account_name', $account_type, $tax_code)";
function update_gl_account($account_code, $account_name, $account_type, $account_code2, $tax_code)
{
+ $account_name = db_escape($account_name);
$sql = "UPDATE ".TB_PREF."chart_master SET account_name='$account_name',
account_type=$account_type, account_code2='$account_code2',
- tax_code=$tax_code WHERE account_code = $account_code";
+ tax_code=$tax_code WHERE account_code = '$account_code'";
db_query($sql, "could not update gl account");
}
function delete_gl_account($code)
{
- $sql = "DELETE FROM ".TB_PREF."chart_master WHERE account_code=$code";
+ $sql = "DELETE FROM ".TB_PREF."chart_master WHERE account_code='$code'";
db_query($sql, "could not delete gl account");
}
function get_gl_account($code)
{
- $sql = "SELECT * FROM ".TB_PREF."chart_master WHERE account_code=$code";
+ $sql = "SELECT * FROM ".TB_PREF."chart_master WHERE account_code='$code'";
$result = db_query($sql, "could not get gl account");
return db_fetch($result);