note 68997 added to function.mysql-fetch-row
| From: | (dot) | Date: | Fri, 18 Aug 2006 21:37:10 +0000 |
| Subject: | note 68997 added to function.mysql-fetch-row | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116041@lists.php.net to get a copy of this message | ||
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
----
Server IP: 66.163.161.117
Probable Submitter: 74.246.128.26
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-row.php
Edit -- https://master.php.net/note/edit/68997
Del: integrated -- https://master.php.net/note/delete/68997/integrated
Del: useless -- https://master.php.net/note/delete/68997/useless
Del: bad code -- https://master.php.net/note/delete/68997/bad+code
Del: spam -- https://master.php.net/note/delete/68997/spam
Del: non-english -- https://master.php.net/note/delete/68997/non-english
Del: in docs -- https://master.php.net/note/delete/68997/in+docs
Del: other reasons-- https://master.php.net/note/delete/68997
Reject -- https://master.php.net/note/reject/68997
Search -- https://master.php.net/manage/user-notes.php