To implement a database storage picture related issues

Source: Internet
Author: User
Implementing database Storage Picture issues
index.php file
PHP Code
  
   
  
   
  
   inserting MySQL pictures
  
   
   
Show pictures


------Solution--------------------
Picture Markers

What is this URL? Is the address of the picture on the website?
So what are you outputting?
echo ""
$fet [path] is not the content of the picture?
------Solution--------------------
Database storage Path: Open a folder to save pictures
PHP code
!--? phpinclude ("conn.php"); $f = $HTTP _post_files[' File ']; $dest _dir= './abc ';//Set upload directory $extend =explode (".", $f [' name ']), $kuozhan =end ($extend);//Get file extension $dest = $dest _ Dir. '/'. Date ("Ymdhms"). '. '. $kuozhan;//file named Current time $r=move_uploaded_file ($f [' Tmp_name '], $dest), chmod ($dest, 0755);//Set the properties of the uploaded file if ($r) {$sql = "    Insert into path (PATN) VALUES (' $dest ');     $queryt =mysql_query ($sql);    echo "";    } else {echo "";    } $sqlpic = "SELECT * from path ORDER BY id desc LIMIT 1";//Check out the latest record $query 2=mysql_query ($sqlpic);    $result =mysql_fetch_array ($query 2); $picpath = $result [' Patn '];//the latest picture path?--"> 
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.