[Solved] How to save a message with an image in a database [closed]
Option 1: Add image upload to your website and save image’s url to database. Option 2: Use base64_encode() for converting image to text. $image = file_get_contents($_FILES[‘your_fileupload_name’][‘tmp_name’]); $ext = pathinfo($_FILES[‘image’][‘name’], PATHINFO_EXTENSION); $base64 = ‘data:image/’ . $ext . ‘;base64,’ . base64_encode($image); Then you save $base64 to your database, and you can convert it to image using base64_decode() … Read more