Algorithms Arrays Passwords Uncategorized
Commerce Uncategorized
Databases Abstraction Layers Informix LDAP MS SQL MySQL ODBC PostgreSQL Uncategorized
Date & Time Calculators Conversion Translation Uncategorized
Discussion Chat Forums Guestbooks Polls Uncategorized
Email Validation Uncategorized
External Uncategorized
Files and Directories Uncategorized
Games Uncategorized
Graphics 3-D Graphs Resizing Thumbnails Uncategorized
HTML Forms Menus & Navigation Source Viewers Tables Templates Uncategorized
HTTP Authentication Cookies File Uploading Uncategorized
I18N Uncategorized
Math Uncategorized
Miscellaneous Uncategorized
Searching and Trees Uncategorized
Security Uncategorized
Text Uncategorized
Utilities Calendars Counters Link Checkers Weather Uncategorized
XML Uncategorized
| php sample source codes |
|---|
|
This is an example code for getting PostgreSQL metadata from its system tables.
I've seen several metadata functions that are not using PostgreSQL system tables, so I posted this.
This function can get metadata MUCH faster than using many pg_Field*().
|
|
Tired with adding quotes around vars for SQL query? Do you want to make sure supplied values are valid for fields? Do you want to use database default value, if user send no values and default value is defined for the field? Then this function might be useful.
|
|
Provides a front end scanner/parser to convert a human formated search into a TSearch2 plus ILIKE components of a SQL WHERE clause.
System requirements are as follows:
1. A PostgreSQL database installation with the TSearch2 extension.
2. PHP5 (you could modify the source to run under PHP4 without much difficulty.)
Features
These are the primary features of the parser:
* Simple to use.
* Entirely written in PHP5 with no dependencies.
* Allows the user to enter search strings in a natural way and can apply a default "AND" between keywords.
* Provides error information suitable for user consumption.
* Supports unlimited depth of expression nesting using parenthesis.
* Supports exact phrase searches using double-quotes.
* Returns an array of individual keywords for highlighting the result sets.
The code is very basic and could probably be adaped for other uses quite easily. Generally a parser creates a parse-tree, but in this case I didn't need that step and the parser does the actual search clause generation.
I code using a MVC paradigm, so I named the class as such (a model component in this case.)
Please don't hesitate to contact me if you have questions or find a bug.
Enjoy,
Matthew
|
|
Easy way to access database and store fetched results.
Database connection and query operation implemented in a separate class to play with multiple query results simultaneously over the same connection.
|
|
This is a very lightweight tool for PostgreSQL, if you used to using psql client than you will be at home with this. It connects to the database, (after you change the connection string), grabs the list of tables, displays their attributes, and lets you enter sql queries and view the output.
|