WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Function Query2Array will read an PEAR-DB-Query-Result into an Array. You may specify a Column used as Array-Keys, and you may specify the Number of Rows to skip at the beginning and the Number to fetch (-1 = infinite).
Categories : Functions, PHP, Databases Update Picture
Thomas Kunth
Date : Jan 14th 2002
Grade : 3 of 5 (graded 2 times)
Viewed : 8168
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Thomas Kunth
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php

// DB.php is part of PEAR.
// It should be installed with PHP by default.
// Also the Include-Path for PEAR should be set by default.

// Take a look at
// http://www-user.tu-chemnitz.de/~meal/php/peardoc/index.html
// http://pear.php.net/
// http://www.koehntopp.de/php/




require_once("DB.php");



function Query2Array ( $result, $keyColumn = NULL, $skipRows = 0, $fetchRows = -
1 ) {
$retval = array();

if ( $skipRows >= $result->numRows() ) $skipRows = 0;

for ( $i = 1; $i <= $skipRows; $i++) $result->fetchRow();

$Rows = $result->numRows() - $skipRows;
if ( $fetchRows >= 0) $Rows = Min($Rows, $fetchRows);
$fetchRows = $Rows;

for ($i = 0; $i < $fetchRows; $i++ ) {
$row = $result->fetchRow();

if ( is_string($keyColumn) ) $retval[$row[$keyColumn]] = $row;
else $retval[] = $row;
}

return $retval;
}
?>





normalize fields and strings used in where (command's Sql)
Categories : PHP, Databases, Oracle, Functions
This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server.
Categories : Databases, MySQL, Complete Programs, PHP, Databases
Visits-tracking
Categories : PHP, Databases, MySQL, Errors and Logging, Functions
Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0.
Categories : Databases, PHP, mSQL, Databases
Add, Edit /Update & Delete all in one Contact Management Form
Categories : PHP, MySQL, Databases, Beginner Guides
GroupIT Engine v1.00rc1
Categories : PHP, Content Management, MySQL, Databases
mySQL/PHP/search with multientry form and table output with colored rows
Categories : PHP, Beginner Guides, MySQL, HTML and PHP, Databases
This functions makes it easy to use session-variables known from ASP. With one Cookie the array "session" will save and restore from a db-record. In this version MySQL is used but it's should very easy to change
Categories : PHP, Arrays, Cookies, MySQL, Databases
List people whose birthdays fall on the current Day and Month
Categories : Databases, Date Time, MySQL, PHP
AITSH Statistics
Categories : Complete Programs, Databases, HTML and PHP, Sessions, PHP
Newbie Notes #4 - Trapping dumb MySQL query errors
Categories : PHP, Databases, MySQL, Debugging, Beginner Guides
email new items in db
Categories : PHP, Email, Databases, MySQL, Beginner Guides
complete, simple, working example of a login screen/system using php functions, cookies, and a mysql database for begginers.
Categories : Authentication, Complete Programs, PHP, MySQL, Databases
This script will return all of the information in every table listed in $myarray, and will return lists of field names and information for each item,
Categories : PHP, MS Access, Databases
Recordset Class like ADO Recordset (plus DataBase Splitting feature) using ODBC functions
Categories : PHP Classes, ODBC, Databases, PHP