Airline Mogul Forum

SQL error searching for gates with less than 3 chars

Chavaquiah

  • Airline Supervisor
  • **
    • Posts: 698
  • E outra vez conquistaremos a Distância
    • View Profile
    • SkyPact-Concept Alliance
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.


dktc

  • Administrator
  • Airline Board Member
  • *****
    • Posts: 4621
    • View Profile
Reply #1 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...).
D Express (id 616) 8)
AM Membership Officer / Official Broker


Chavaquiah

  • Airline Supervisor
  • **
    • Posts: 698
  • E outra vez conquistaremos a Distância
    • View Profile
    • SkyPact-Concept Alliance
Reply #2 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.


dktc

  • Administrator
  • Airline Board Member
  • *****
    • Posts: 4621
    • View Profile
Reply #3 on: August 28, 2008, 11:52:34 pm
That is true too.
D Express (id 616) 8)
AM Membership Officer / Official Broker


 

SMF spam blocked by CleanTalk