When I manually update a database in phpMyAdmin this is the code it uses:
UPDATE `test`.`users` SET `number` = '12' WHERE `users`.`id` =1;
This is the code I normally use in php when I write queries manually:
UPDATE `users` SET `number` = '12' WHERE `id` =1;
What is the difference?
More importantly, which is better to use and why? Please answer the why, Thank You.
The one phpMyAdmin just includes the database name as well as the table name.
In PHP, this is generally not needed, because you specify the database using
mysqli_select_dbormysqli_connect.Both are equivalent; the only difference is the way the database is selected. In the first one, the database is specified explicitly in the query, in the second one, the database name is implied, since you specify it with
mysqli_select_dbormysqli_connect.