how to use php+mysql to decode the image stream and store the stream to database

so i need to add an image into Mysql via php file.. i selet that image from an UWP app : which upload the image a stream .. Now i'm stuck as i don't know what from there .. Here is the Php code i'm using but it's not working as i do find an image.png but it displays nothing .. any help would be appreciated

  $UserName = $_POST['UserName'];
 $UserImage = $_POST['UserImage'];
 $sql ="SELECT  UserId FROM user";
 $res = mysqli_query($connect,$sql);
 $UserId =0 ;
 while($row = mysqli_fetch_array($res)){     
 $UserId = $row['UserId'];
 $UserId = $UserId+1;
 $path = "UserImage/$UserId.png";
 $actualpath = "http://localhost/mydatabase/$path";
 $sql = "INSERT INTO user (UserId,UserName,UserImage) VALUES ('$UserId','$UserName','$actualpath')";
 echo "Successfully Uploaded";

 echo "Error";


Check your $actualpath matches with the $path where you uploaded. It seems they are not matching.

Need Your Help

Undefined reference to QGLFormat

c++ qt qtwidgets

I'm trying to compile my QGLWidget object for a simple painting program, but i'm getting some pretty strange errors I can't understand.

CakePHP 2.3 Console Schema: the chosen schema could not be loaded

cakephp cakephp-2.0 cakephp-2.1

I have a number of Plugins for my CakePHP 2.3 app which I use the schema migrations built in to maintain DB table structure.