How to add an avatar to the database?

There are several pictures (avatars) in the registration. How to make the selected image entered into the avatarkatable?

Answer 1, authority 100%

Every DBMS has a blobfield. The data is stored and processed as an array of bytes. For example, in SQLite: Datatypes In SQLite Version 3.

Answer 2

Well, for example, avatars are selected using select with name=avatarka. In the handler we write:

$href = mysql_escape_string($_POST['avatarka']);
mysql_query("INSERT INTO avatarka(iduser,href) VALUES('$iduser','$href')") or die(mysql_error()); //Where iduser is the user's id.