Airline Mogul Forum

Airline Mogul => Bugs => Topic started by: Chavaquiah on August 28, 2008, 10:12:21 pm

Title: SQL error searching for gates with less than 3 chars
Post by: Chavaquiah on August 28, 2008, 10:12:21 pm
In Gates --> Rent Gate, with view set to "Search", if a code with less than 3 characters is entered (or, indeed, no code at all), the game generates an error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY `ap`.`airport_name` ASC' at line 4
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/(...)/gates.php on line 485


This is, of course, no bid deal. Just for the record.
Title: Re: SQL error searching for gates with less than 3 chars
Post by: dktc on August 28, 2008, 10:25:37 pm
Basically, you have to enter 3 or 4 characters for that script to be able to work. Anything less would result in an error due to the nature of the variable (if i read the erro correctly...).
Title: Re: SQL error searching for gates with less than 3 chars
Post by: Chavaquiah on August 28, 2008, 11:25:56 pm
Precisely. Less than 3 characters would be player error, anyway, that's why this is not at all important.

However, it hints at having player input not fully validated before beeing fed to MySQL.
Title: Re: SQL error searching for gates with less than 3 chars
Post by: dktc on August 28, 2008, 11:52:34 pm
That is true too.