In mysql I use this code
$somenumber=5;
$result = mysql_query("SELECT * FROM some_table")
while($row = mysql_fetch_array($result)) {
echo $row['id'.$somenumber];
}
Please help me to do the same in the best way using mysqli, probably oop style I think cause everybody say best way to use oop way. Sorry I’m just studding this
To do it with MySQLi OOP, you create an object, then call it’s
query()method.If you have input parameters which you’ll pass into your query, escape them with
real_escape_string()The principle benefits of
MySQLiover the oldermysql_*API areextended with your own classes.