Zend - The PHP Company




Databases

Add Code


Connect to mutiple fields/tables function  

Type: application
Added by: mbills2
Entered: 28/07/2006
Last modified: 08/12/2008
Rating: ** (4 votes)
Views: 4581
Function for connecting to databases by creating arrays and calling the function.


Database query generator  

Type: code fragment
Added by: gilhildebrandjr
Entered: 04/06/2001
Last modified: 04/12/2008
Rating: **** (9 votes)
Views: 17938
These functions take input from a form and generate a string which can be used in a database query. If you do a lot of database work, this will make your life much easier.


DB Row Helper v1.0  

Type: class
Added by: eineke
Entered: 26/05/2002
Last modified: 05/12/2001
Rating: - (fewer than 3 votes)
Views: 5561
mysql/database helper class


DB_Pager  

Type: class
Added by: comprock
Entered: 09/11/2002
Last modified: 31/10/2008
Rating: *** (4 votes)
Views: 8697
/** * Class DB_Pager * * Class to build dynamic database paging links. * * Based upon Joao Prado Maia (jpm@musicalidade.net) class navbar. * * Functions: * DB_Pager($use_text_links = true) * build_links($option = 'all', $show_blank = false) * build_url() * display_links($sep_left = ' ', $sep_right = ' ') * execute($sql, $db, $type = 'mysql') * mk_link($href, $text = '', $target = '', $name = '') * num_links_shown($links_to_show) * rows_per_page($rows_to_show) * * @author Michael Cannon * @package cb_common * @version $Id: class.DB_Pager.php,v 1.5 2002/11/08 17:55:42 mcannon Exp $ */


Delete  

Type: code fragment
Added by: RLYNCH
Entered: 13/02/2000
Last modified: 08/12/1999
Rating: *** (10 votes)
Views: 13890
A very brief sample of how to delete items from a database.


Dynamic Website  

Type: application
Added by: hanigamal
Entered: 14/02/2005
Last modified: 02/12/2004
Rating: - (fewer than 3 votes)
Views: 7260
Snippet which retrieves a field from the DB and show it in the body between included header page and footer page


Echelon SQL Scripter  

Type: application
Added by: 12feet
Entered: 16/08/2001
Last modified: 08/12/2000
Rating: - (fewer than 3 votes)
Views: 8219
Very Simply: 1.) Create database table with all of the columns you need. 2.) Create HTML form (name the HTML form elements the same as your column names). 3.) Point form action to the Echelon Script with the appropriate table name & action to perform (insert, update, or delete). And you're done! Echelon takes care of all of the SQL scripting for you. It will connect to the database, it will either insert, update or delete the appropriate data, then it will redirect back to the file of your choice. This allows the web developer to modify database information very quickly when using HTML forms. Echelon cuts out the time consuming, repetitive, and hand written modification queries.


K.Palani  

Type: class library
Added by: idiskp
Entered: 11/02/2005
Last modified: 02/12/2004
Rating: - (fewer than 3 votes)
Views: 5145
Name: K.Palani, email: ilikephp@yahoo.co.in It is a simple form wizard. The form contains all basic database functions and is styled like Visual Basic/FoxPro environment. The form is not using any external libraries. It is pure PHP and HTML. The code is very simple to understand and can be used by beginners and intermediate programmers. It has lot of scope for improvement. The beauty of the form is that it is a single form and it is not like clicking somewhere and viewing somewhere else. The form has navigation buttons like MoveFirst, Next, Previous, MoveLast, Search, Delete. Also, there are buttons for inserting and updating records. Primary key values can be searched using the search button. Values are fetched from table using the primary key value. It is ideal for creating table master forms and can be included in the project. Step 1: The user may copy these files including /lib sub folder in the place understood by PHP and Apache web server. Step 2: The user may copy the billunit.php and name it differently. Connection parameters may be set in 'lib/conn.php'. Step 3: The table name may be passed to the '$tablename' variable. Primary key field name may be passed to the '$pk' variable. Step 4: A table template may be created/modified suitably according to your table requirements like label for the field and text input. The sample 'billunit.php' contains 3 fields. Step 5: The names of the text input may be passed in the action buttons of 'Insert' and 'Update' as shown in the example. That is all. Save it and run from your browser. Comments/criticisms/suggestions are welcome. I am at ilikephp@yahoo.co.in .


Load a file into a database  

Type: class
Added by: Scha
Entered: 19/09/2000
Last modified: 01/12/2000
Rating: **** (8 votes)
Views: 14093
This class will load a file that is separated by anything into a table in a database. There is an example on how this is done at the start of the file.. so.. ehmm.. enjoy


loadtodb  

Type: application
Added by: kosala
Entered: 22/10/2003
Last modified: 31/10/2002
Rating: - (fewer than 3 votes)
Views: 4247
Class to load n/a separated files into a database


MySQL  

Type: code fragment
Added by: balajir
Entered: 06/02/2004
Last modified: 02/12/2003
Rating: - (fewer than 3 votes)
Views: 6808
fuction to display next, previous links for a query and query is returned with limits


MySqlFront  

Type: application
Added by: pk_jsp
Entered: 12/09/2003
Last modified: 09/12/2002
Rating: - (fewer than 3 votes)
Views: 7125
This web basedapplication acts as an interface to mySql Database and provides amost of the facilities like querying,viewing log etc.


PHP MySQL Database Class v1.0.0  

Type: class
Added by: micahcarrick
Entered: 21/04/2005
Last modified: 04/12/2004
Rating: ***** (7 votes)
Views: 18870
A class for very basic MySQL database connectivity. Written to reduce redundant code in my own projects aswell as aid in debugging and error reporting during the developement phase. Currently connects to a database, execute external files containing SQL commands, insert and update from an array of key => value pairs, insert and update with sql command, query (one result), query (multiple rows), and dump a select query to a table. The zip file contains the class aswell as a demonstration script. See a screenshot and/or download the example file at http://www.micahcarrick.com/v2/content/view/3/3/


Rapid Form 2 Database Class  

Type: class
Added by: gilhildebrandjr
Entered: 14/10/2004
Last modified: 31/10/2003
Rating: - (fewer than 3 votes)
Views: 7216
This class is the missing link between an html form and its associated database table. It is designed to accept posted form data and input it directly into a database, without having to manually type a list of each form field in the traditional manner.


SQL to Table  

Type: code fragment
Added by: mechtonia
Entered: 08/07/2003
Last modified: 05/12/2010
Rating: - (fewer than 3 votes)
Views: 6403
This code snippet takes an SQL SELECT statment and intelligently generates a nicely formatted html table based on clues from the SQL statment.


SQLite Iterator  

Type: class library
Added by: jka
Entered: 07/11/2005
Last modified: 02/12/2005
Rating: - (fewer than 3 votes)
Views: 3330
Two simple PHP classes for working with SQLite database files. It includes exceptions and foreach statement for query result iterating.


Storing / Retrieving pictures from database  

Type: code fragment
Added by: imthiazrafiq
Entered: 23/07/2002
Last modified: 07/12/2001
Rating: - (fewer than 3 votes)
Views: 12428
Hi folks I have searched many sites for storing a picture into a database and retrieve the same. But I got some tutorials when I searched the web. Using the tutorials I have a made one for me. It was implemented using Php and Mysql. I will tell you want is the job of each files. 1). index.php This files links all the files in the project. 2). store.php This does the job of storing the picture into the database. 3). viewadd.php This file shows the entire picture stored in the database. 4). getpicture.php This file actually gets the file from file in the form of picture 5). mdbc.inc.php This is a class file for Mysql feel free to use. I got this over net. Here is the table description Id - > has the picture id Description -> has the picture description bin_data -> picture data filename -> picture file name filetype -> picture file type. Like gif or jpeg etc link -> you can store the link incase if you want to use this for ad exchange showno - > no of time ad show etc clickcount -> no of time the ad being clicked etc Query for the table. CREATE TABLE ads ( id varchar(15), description varchar(255), bin_data LONGBLOB, filename varchar(50), filesize varchar(50), filetype varchar(50), link varchar(255), shownno integer(5), clickcount integer(5), unique(id) ); If you want to see a site where I have implemented please have a look at the site http://www.asksathia.com/ Feel free to change anything in the code. If you developed a better version than this please send me the source code so that I may update myself. It took me much time when commenting the code of ease of understanding. Please vote for me. Regards Imthiaz Rafiq imthiazrafiq@gmx.net Msn id: imthiazrafiq@gmx.net Yahoo id: imthiazrafiq ICQ: 24294947 URL: http://high-flyer.da.ru


waf_log class  

Type: class
Added by: fpapleux
Entered: 05/08/2003
Last modified: 08/12/2002
Rating: - (fewer than 3 votes)
Views: 3859
the waf_log is a class-based log system to record specifics that you don't want to dig the web server's log for. It connects to a DBDRIVER previously posted in DB Abstraction Layers


ZBase  

Type: class library
Added by: meuuh
Entered: 25/05/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 10838
ZBase is an object framework written in PHP4 allowing to develop the www frontend of a database very quickly and simply. In ZBase, each entry in the database can be considered as an object, and ZBase provides standard methods to modify or display its content.



Search



This Category All Categories