0

One a game I am making I have a saving bug. I have an alert with the PHP message. It gives me an SQL error. The problem is obvious. That last comma before the parentheses shouldn't be there. The question is why is it there? In my code, it isn't.

This is the alert message.

Alert Message

The statement is like this.

> $query2 = "INSERT INTO users VALUES ('$village', $power, $influence, $gold, NULL, $ore, $wood, $food, $honor, $keep, $mine, $sawmill, $farm, $barracks, $tavern, $stables, $temple, $militia, $warriors, $spearmen, $clubmen, $swordsmen, $archers, $vanguards, $legion, $crossbowmen, $knights, $mercs, $mercelites, $bandit1, $bandit2, $bandit3, '$faction', $dwellings, $dwellingscost);";

One of my theories was that the dwellingscost variable had a comma at the end. It is posted from an AJAX request. If you need some of that code to decipher just ask.

I. Smith
  • 85
  • 1
  • 9

0 Answers0