A php code result

Source: Internet
Author: User
PHPcode & lt ;? Php $ DBserver & quot; localhost & quot; $ DBname & quot; lookdb & quot; $ DBuser & quot; root & quot; $ DBpassword & quot ;; $ conmysql_connect (& q: PHP code result problems
PHP code
  
  File name:", $ File ,"
"; ListDir ($ dir."/". $ file."/");} else {if ($ file! = "." & $ File! = ".. ") {Echo $ file. ""; $ arr = explode ("", $ file); print_r ($ arr); $ SQL = "insert into contents (pai_title) value ('{$ arr }') ";}}} closedir ($ dh) ;}} return ($ file) ;}listdir (" C: /AEED/PHPnow/htdocs/2003Z/nz/");?>



Result:
Nz01.pdf Array ([0] => nz01.pdf) nz02.pdf Array ([0] => nz02.pdf) nz03.pdf Array ([0] => nz03.pdf) nz04.pdf Array ([0] => nz04.pdf) nz05.pdf Array ([0] => nz05.pdf) nz06.pdf Array ([0] => nz06.pdf) nz07.pdf Array ([0] => nz07.pdf) nz08.pdf Array ([0] => nz08.pdf) nz09.pdf Array ([0] => nz09.pdf) nz10.pdf Array ([0] => nz10.pdf) nz11.pdf Array ([0] => nz11.pdf) nz12.pdf Array ([0] => nz12.pdf) nz131_array ([0] => nz131_) nz141_array ([0] => nz141_) nz151_array ([0] => nz151_) nz161_array ([0] => nz161) nz17.pdf Array ([0] => nz17.pdf) nz18.pdf Array ([0] => nz18.pdf) nz19.pdf Array ([0] => nz19.pdf) nz20.pdf Array ([0] => nz20.pdf) nz21.pdf Array ([0] => nz21.pdf) nz22.pdf Array ([0] => nz22.pdf) nz23.pdf Array ([0] => nz23.pdf) nz24.pdf Array ([0] => nz24.pdf) nz251_array ([0] => nz251_) nz261_array ([0] => nz261_) nz271_array ([0] => nz271_) nz281_array ([0] => nz281) nz291_array ([0] => nz291_) nz301_array ([0] => nz301_) nz31.pdf Array ([0] => nz31.pdf) nz32.pdf Array ([0] => nz32.pdf) nz33.pdf Array ([0] => nz33.pdf) nz341_array ([0] => nz341_) nz351_array ([0] => nz351_) nz361_array ([0] => nz361) nz371_array ([0] => nz371_) nz381_array ([0] => nz381_) nz391_array ([0] => nz391_) nz401_array ([0] => nz401) nz41.pdf Array ([0] => nz41.pdf) nz42.pdf Array ([0] => nz42.pdf) nz43.pdf Array ([0] => nz43.pdf) nz44.pdf Array ([0] => nz44.pdf) nz45.pdf Array ([0] => nz45.pdf) nz46.pdf Array ([0] => nz46.pdf) nz47.pdf Array ([0] => nz47.pdf) nz48.pdf Array ([0] => nz48.pdf) nz491_array ([0] => nz491_) nz501_array ([0] => nz501_) nz51.pdf Array ([0] => nz51.pdf) nz52.pdf Array ([0] => nz52.pdf) nz53.pdf Array ([0] => nz53.pdf) nz54.pdf Array ([0] => nz54.pdf) nz55.pdf Array ([0] => nz55.pdf) nz56.pdf Array ([0] => nz56.pdf) nz57.pdf Array ([0] => nz57.pdf) nz58.pdf Array ([0] => nz58.pdf) nz591_array ([0] => nz591_) nz601_array ([0] => nz601)

I just want to save all the file names in the directory to the database in different entries. This cannot be saved.

------ Solution --------------------
Oh, it's wrong.

$ SQL = "insert into contents (performance_title) value ('{$ arr }')";

$ Arr is an array of explode. it is not executed in this way. what do you want to save?

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.