
Untitled
By: a guest on
Aug 9th, 2012 | syntax:
None | size: 0.55 KB | hits: 5 | expires: Never
how to create table for each user to store their images in mysql database? [closed]
CREATE TABLE tbl_images (image blob NOT NULL );
// store the uploaded file in a temporary variable
$tmpName = $_FILES['image']['tmp_name'];
// Read the file
$fp = fopen($tmpName, 'r');
$data = fread($fp, filesize($tmpName));
$data = addslashes($data);
fclose($fp);
// Create the query and insert
// into our database.
$query = "INSERT INTO tbl_images VALUES ('$data')";
$results = mysql_query($query);