note 68997 deleted from function.mysql-fetch-row by philip
| From: | philip@php.net | Date: | Mon, 26 Feb 2007 06:53:06 +0000 |
| Subject: | note 68997 deleted from function.mysql-fetch-row by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123867@lists.php.net to get a copy of this message | ||
Note Submitter: scottd AT ucann2 (dot) org
----
After reading the above, this information didn't help. I am new to php so, after trying and
trying, I came to this solution..
GOAL :
To create directories from a database:table that has multple affected arrays.
SYNTAX I USE:
<?
function find_false() {
global $connect;
$Q="select * from
table_name where tf='false'";
$result=mysql($Q,$connect);
$longi=mysql_affected_rows($result); // used for logging
$count=mysql_num_rows($result);
$i=0;
while($i<$count) {
$list=mysql_fetch_rows($result);
logger("Updating [$i], $list[0]...\n");
<- DO SOME OTHER STUFF NEEDED ->
mkdir($list[0]/home);
$update="UPDATE table_name SET tf='true' where
name=$list[0]'";
mysql_query($update,$connect);
$i++
}
}
?>
This may seem simple to some, but to a newbie, It can be some-what confussing. Sometimes, things
can get complicated for now reasons.
David