This is an excellent example of WHY you need to always CC: the list on all responses. I cannot specifically answer your response because I do not use enough PHP to help. In extremely generic terms, what you need to do is:
a) connect to the database server b) send to the database server an INSERT statement or sequence of INSERT statements based on the results of your folder recursions. c) disconnect from the server. If you need to do something else with the data within the same script, you probably want to delay disconnecting from the server. Have you tried looking at the PHP examples for working with a MySQL database for guidance? Shawn Green Database Administrator Unimin Corporation - Spruce Pine "Brian e Boothe" <[EMAIL PROTECTED]> wrote on 11/01/2005 12:20:07 AM: > I know that…. I know what i want to do and yes ive wrote the PHP > backend, I just need to get it into mysql tables for later lookup > > <<< * CODE------------------------------------- > Start----------------------------------------CODE *>> > > > <? > echo '<pre>'; > print_r(recrusive_dirlist('/inetpub/wwwroot/Products/')); > echo '</pre>'; > ?> > > > <? > /* > This function retuns all directory and file names from the given directory. > Works recrusive. > */ > function recrusive_dirlist($base_dir) > { > global $getDirList_alldirs,$getDirList_allfiles; > function getDirList($base) > { > global $getDirList_alldirs,$getDirList_allfiles; > if(is_dir($base)) > { > $dh = opendir($base); > while (false !== ($dir = readdir($dh))) > { > if (is_dir($base . $dir) && $dir !== '.' && $dir !== '..') > { > $subs = $dir ; > $subbase = $base . $dir . '/'; > $getDirList_alldirs[]=$subbase; > getDirList($subbase); > } > elseif(is_file($base . $dir) && $dir !== '.' && $dir !== '..') > { > $getDirList_allfiles[]=$base . $dir; > } > } > closedir($dh); > } > } > > getDirList($base_dir); > $retval['dirs']=$getDirList_alldirs; > $retval['files']=$getDirList_allfiles; > return $retval; > } > ?> > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 01, 2005 11:09 AM > To: Brian e Boothe > Cc: mysql@lists.mysql.com > Subject: Re: Folder recursion > > > > "Brian e Boothe" <[EMAIL PROTECTED]> wrote on 10/31/2005 10:21:35 PM: > > > I.m needing assistance in get a problem Solved , > > > > What im attempting to do is have MySQL thru asp or PHP look thru > > Folders and add to a Mysql database the path and folder name and file > > located within that directory into the database, can anyone help me ?? or > > give me hints > > > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005 > > > > I am mostly confused about you are actually trying to do. I think > you are trying to crawl a directory tree with MySQL by calling an > ASP or PHP script. > > I think you have chosen the wrong tool to automate a directory scan. > Either PHP or ASP can do the directory navigation work that you > describe but MySQL is a database server. Its role in this situation > would be to store and retrieve results not to control the process. > > In ASP, you would instantiate a "Scripting.FileSystemObject" object > and use its properties and methods to navigate your directory > structures. You would use the ADODB.xxx objects to interact with a > MySQL database through a MyODBC driver. > > I don't know what you would use in PHP to crawl file system folders > but many PHP installations have the mysql_xxx functions activated by > default. You would not need to use any other > objects/libraries/drivers to interact with the MySQL database if you > used the native mysql_xxx functions. > > Shawn Green > Database Administrator > Unimin Corporation - Spruce Pine > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005 > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005