note 62465 added to function.array-walk
| From: | www dot eltayb dot com at osu1 dot php dot net | Date: | Wed, 01 Mar 2006 10:01:46 +0000 |
| Subject: | note 62465 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104604@lists.php.net to get a copy of this message | ||
HI,
i think we can use this function also in altering the MySQl query results with this method :-
1- make a new connection with data bas and select the specified database as known .
2- we'd make a query for example ouput all usernames saved in table called "users" as
:-
$query = "SELECT * FROM users ORDER BY id DESC";
3-we'd exceute this query now :-
$result = mysql_query($query,$link);
as $link is the database connection handler variable .
4-we'd now ouptut the results and push them in a new array called "users" for example
:
while ($row = mysql_fetch_array($result)) {
{array code goes here}
}
5-We'd now use that function in altering the array with any new modifications we need like
making all letters in some field must be caps or filtering some another one and many many
modifications !
yours ,
Ahmed (Eltayb.Com) .
----
Server IP: 66.163.161.117
Probable Submitter: 196.204.163.1 (proxied: 1.0 Symantec_Web_Security (3.0.1.74))
----
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.array-walk.php
Edit -- http://master.php.net/note/edit/62465
Del: integrated -- http://master.php.net/note/delete/62465/integrated
Del: useless -- http://master.php.net/note/delete/62465/useless
Del: bad code -- http://master.php.net/note/delete/62465/bad+code
Del: spam -- http://master.php.net/note/delete/62465/spam
Del: non-english -- http://master.php.net/note/delete/62465/non-english
Del: in docs -- http://master.php.net/note/delete/62465/in+docs
Del: other reasons-- http://master.php.net/note/delete/62465
Reject -- http://master.php.net/note/reject/62465
Search -- http://master.php.net/manage/user-notes.php