How to assign a variable to the last value from the desired column in the mysql database table using php? for example, the table "tanks" after the entry id-45, name-t34, so that t34 is written to the variable $ tank
2 answers
$query = mysqli_query("SELECT `name` FROM `tanki` ORDER BY `id` DESC LIMIT 1"); $tank = mysqli_fetch_assoc($query); $tank = $tank['name']; |
select top 1 name from table order by id desc - Welcome to Stack Overflow in Russian! Please try to leave a little more detailed answers. You can add an answer by clicking edit - aleksandr barakin
|