This is the original code I am trying to write in object oriented form..
$posResult = mysql_query("SELECT MAX(position)+1 FROM todo");
if(mysql_num_rows($posResult))
list($position) = mysql_fetch_array($posResult);
This is where I am at.... I think I need to bind_result? also, I have an issue with the mysql_fetch_array...
if($stmt = $this->HH->Database->prepare("SELECT MAX(position)+1 FROM todo")) {
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows != FALSE) {
list($position) = mysql_fetch_array($posResult);
}
}
Can someone advise on how to correct this?
$this->HH->DatabaseMysqli or PDO?