I am trying to insert some values into a database, one of the values that I need to insert is;- MAX(FixedFareID)+1
As follows:
public function fixed($fieldDay) {
$pdo = new SQL();
$dbh = $pdo->connect(Database::$serverIP, Database::$serverPort, Database::$dbName, Database::$user, Database::$pass);
$this->sql = "INSERT INTO tblfixedfare VALUES (NULL, MAX(FixedFareID)+1, '1', '$fieldDay')";
Obviously, as it is this will not work, but I am unsure how I could insert the MAX(FixedFareID)+1 value into the database.
Any help would be much appreciated.
1 Answer