  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                ต้องการกำหนดขนาดรูปที่จะuploadลงในฐานข้อมูลค่ะ ขนาด110x125 pixels ค่ะ 
 
 
Code (PHP) 
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?
	if(copy($_FILES["filUpload"]["tmp_name"],"myfile/".$_FILES["filUpload"]["name"]))
	{
		echo "Copy/Upload Complete<br>";
		//*** Insert Record ***//
		$FilesID=$_POST['txtbook_id'];
		$ISBN = $_POST['txtISBN'];
		$book_author = $_POST['txtauthor'];
		$book_pub=$_POST['txtpub'];
		$book_date=$_POST['txtdate'];
		$book_origin=$_POST['txtorigin'];
		$book_detail=$_POST['txtdetail'];
		$type_id=$_POST['lmName1'];		
		
		$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
		$objDB = mysql_select_db("library");
		mysql_query("SET character_set_results=tis620");
mysql_query("SET character_set_client='tis620'");
mysql_query("SET character_set_connection='tis620'");
mysql_query("collation_connection = tis620_thai_ci");
mysql_query("collation_database = tis620_thai_ci");
mysql_query("collation_server = tis620_thai_ci");
		$strSQL = "INSERT INTO books ";
		$strSQL .="(FilesID,ISBN,Name,book_author,book_pub,book_date,book_origin,book_detail,FilesName,type_id) 
		VALUES ('$FilesID','$ISBN','".$_POST["txtName"]."','$book_author','$book_pub','$book_date','$book_origin','$book_detail','".$_FILES["filUpload"]["name"]."','$type_id')";
		$objQuery = mysql_query($strSQL);	
			echo "<script>window.location='books.php'</script>";exit();	
	}
	
?>
<a href="books_show.php">View files</a>
</body>
</html>
 
 
  Tag : PHP               
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2013-01-07 00:40:29 | 
                      By :
                          miengkam | 
                      View :
                          1212 | 
                      Reply :
                          5 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |