//SELECT DB
$con = mysqli_connect("localhost","root","","database");
//FETCH DATA FROM TABLE1
$check= mysqli_query($con, "select * from user_info_tbl where username = '$user_check' ") or die(mysqli_error($con));
$row = mysqli_fetch_array($check);
$username = $row["username"];
$picture = $row["picture"]; //my way of getting the blob file to table1
$content = addslashes($_POST["content"]); //this is from an input tag
//INSERTING DATA TO TABLE2 INCLUDING THE BLOB FILE
$query1="INSERT INTO postings (prof_pic,user_name, content)
VALUES ('$picture','$username','$content')";
This is my table1
|ID |username | picture
+------+-------------+-----------------+
|1 |user1 | [BLOB -7.3 KiB] |
|2 |user2 | [BLOB -2.4 KiB] |
|3 |user3 | [BLOB -6.0 KiB] |
This is my table2
|ID |prof_pic | username | content
+------+-------------+-----------+-----------+
|1 | | user1 |this is my post
|2 | | user2 |hello world
|3 | | user2 |lets go
But only the username and content are being inserted into the table2. I want to get the 'picture' on table1 to copy on 'prof_pic' on table2, where table1.username = table2.username
Can someone help me, getting the blob file to insert it to another table. Thanks in advance.
PS. Im just a beginner. Sorry for messy codes.