Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 9th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how to create table for each user to store their images in mysql database? [closed]
  2. CREATE TABLE tbl_images (image blob NOT NULL );
  3.        
  4. // store the uploaded file in a temporary variable
  5.       $tmpName  = $_FILES['image']['tmp_name'];  
  6.  
  7.       // Read the file
  8.       $fp     = fopen($tmpName, 'r');
  9.       $data = fread($fp, filesize($tmpName));
  10.       $data = addslashes($data);
  11.       fclose($fp);
  12.  
  13.  
  14.       // Create the query and insert
  15.       // into our database.
  16.       $query = "INSERT INTO tbl_images VALUES ('$data')";
  17.       $results = mysql_query($query);