Hi
Everytime i access my application for the first time, i get the above error.
But when i press the Signin, The error disappears and am redirected to the login page.
I cant seem to find the query that is throwing the error.
Please assist..
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syn
-
- Posts: 29
- Joined: 2016-06-24 02:51
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
DId you checked your _global, header_extras and footer_extras files?
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- Posts: 29
- Joined: 2016-06-24 02:51
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
Hi DevGiu,
I relooked into the 3 files but cannot see any problem with my queries. header_extras is blank, footer_extra has no sql query the only query is in _global.php
Look at how it looks like, please help me identify a problem if there is one.
I relooked into the 3 files but cannot see any problem with my queries. header_extras is blank, footer_extra has no sql query the only query is in _global.php
Look at how it looks like, please help me identify a problem if there is one.
Code: Select all
<?php
// For help on using hooks, please refer to http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks
function login_ok($memberInfo, &$args){
$username = $memberInfo['username'];
$ip = $memberInfo['IP'];
$date = date("Y-m-d H:i:s A");
$details = "LOGIN";
$session_id = session_id();
sql("insert into audit_trail set username = '{$username}', ip = '{$ip}', ts = '{$date}', details = '{$details}'", $eo);
return ' ';
}
/*function logout_ok($memberInfo, &$args){
//$logout = $memberInfo['username'];
$ip = $memberInfo['IP'];
$logout_date = date("Y-m-d H:i:s A");
$details = "LOGOUT";
$session_id_now = session_id();
sql("update audit_trail set logout_ts = '{$logout_date}', logout_details = '{$details}' WHERE session_ID = '{$session_id_now}'", $eo);
return ' ';
}
*/
function login_failed($attempt, &$args){
$username = $attempt['username'];
$ip = $_SERVER['REMOTE_ADDR'];
$ts = date("Y-m-d H:i:s A");
$details = makeSafe("LOGIN FAILED. Username : {$attempt['username']}");
sql("insert into audit_trail set username = '{$username}', ip = '{$ip}', ts = '{$ts}', details = '{$details}'", $eo);
}
function member_activity($memberInfo, $activity, &$args){
switch($activity){
case 'pending':
break;
case 'automatic':
break;
case 'profile':
break;
case 'password':
break;
}
}
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
Insert statement is wrong.
Should be something like
Should be something like
Code: Select all
insert into audit_trail (username, ip, date, details) VALUES ('{$username}', '{$ip}', '{$date}', '{$details})'
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- Posts: 29
- Joined: 2016-06-24 02:51
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
Hi,
I corrected that but the error still persists
I corrected that but the error still persists
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
If you comment the line error disappears? Can you post your corrected sql line¿?
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- Posts: 29
- Joined: 2016-06-24 02:51
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
Hey,
I figured it out.
Its was in links-home.php.
And the line throwing that error was
I figured it out.
Its was in links-home.php.
And the line throwing that error was
Code: Select all
$tenants_count = sqlValue("select count(*) from ".get_sql_from('applicants_and_tenants'));
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
Then probably the error is because SQL is not builded corretly, maybe because get_sql_from('applicants_and_tenants') is returning false or something like this. Are you sure applicants_and_tenants is a table in your system and you have access to it?
Wrap your sql this way
Wrap your sql this way
Code: Select all
$applicants_and_tenants_where = get_sql_from('applicants_and_tenants');
if(!$applicants_and_tenants_where){
// Here get_sql_from is returning false (without access, and table don't exists) and for this reason SQL is not builded correctly and giving an error.
$tenants_count = 0;
} else {
$tenants_count = sqlValue("select count(*) from {$applicants_and_tenants_where}");
}
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- Posts: 29
- Joined: 2016-06-24 02:51
Re: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right
This Worked.
Thank you so much
Thank you so much