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 : Oracle BIND
Categories : Oracle, PHP, Databases Update Picture
Robin Curts
Date : Apr 23rd 2000
Grade : 2 of 5 (graded 1 times)
Viewed : 9463
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Robin Curts
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

I thought I would put in an example of the ORACLE BIND function, because it is so important
for websites with heavy traffic. Oracle has a cache that can be re-used for quicker and more
efficient queries. If you bind a variable to your SQL query, you can make use of this great
feature. Here is a basic example of how this would work:

<?

$my_bind = "VARIABLE"; /* hopefully you can get this value from an HTTP POST */

PutEnv("ORACLE_HOME=/path/to/ORACLE");
PutEnv("ORACLE_SID=YOUR_ORACLE_SID");
$dbh = ocilogon("username","password","SID");

$sql = "SELECT SOMETHING FROM TABLE WHERE SOME_ID = :media_id ";

$sth = ociparse($dbh,$sql);
ocibindbyname($sth,":some_id",&$my_bind,6);
ociexecute($sth,OCI_DEFAULT);
while (ocifetch($sth)) {
$my_output = ociresult($sth,1);
}

?>

By the way... I prefer to leave the '@' symbol off all of my functions. Supressing errors is not
necessarily a good thing. 8)




Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0.
Categories : Databases, PHP, mSQL, Databases
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
StoredProcedure, Stored Procedure, Oracle, OCI8, OCI8i
Categories : OCI8, Oracle, Databases, PHP
normalize fields and strings used in where (command's Sql)
Categories : PHP, Databases, Oracle, Functions
Connecting to Oracle with php3
Categories : Oracle, PHP, Databases
A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, Oracle, PHP, Arrays, Variables
Simple class for accessing databases like MSSql Server, Oracle etc by Raju
Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle
PHP CLASS for ORACLE (database connectivity)
Categories : PHP, PHP Classes, Classes and Objects, Databases, Oracle
myCSV-dump converts a simple CSV-flatfile-database into an MySQL-dump.
Categories : PHP, MySQL, Databases, Complete Programs
Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs.
Categories : Databases, PHP, MySQL, Complete Programs
Authorize Me! An authentication script.
Categories : MySQL, Databases, Authentication, PHP
Multiple Search using PHP and Mysql
Categories : PHP, Databases, General SQL, MySQL
phpAds, a complete banner and ad management system with detailled tracking and stats.
Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases
ADODB Database Wrapper Abstraction Library for PHP: MySQL, MSSQL, Oracle, Interbase,ODBC, Microsoft Access and FoxPro.
Categories : PHP Classes, Databases, PHP, General SQL, ODBC
Point and Click Interface ala MS Access for creating SQL statements.
Categories : MySQL, Complete Programs, General SQL, PHP, Databases
 Luiz Arroyo wrote : 361
In ocibind, is correct to use :some_id instead of 
:midia_id?? 
 
 Robin Curts wrote :362
I wrote :media_id in this example because it`s the 
common "ID NAME" that I use with my development.  
Feel free to use any name you want.

In PERL you are required to use a `?` for a variable bind, 
and it can get confusing if you have many bind variables:

# keep in mind these are just random field names
my $sql = "INSERT INTO TABLE_NAME 
                  (ID,USER,DATE,TITLE,TOPIC)
                  VALUES
                  (?,?,?,?,?) ";

Now while this can be tough to read, PHP allows you to 
write the same code with your own variable names:

$sql = "INSERT INTO TABLE_NAME " 
        .  "(ID,USER,DATE,TITLE,TOPIC) "
         . "VALUES "
         . "(:id,:user,:todaydate,:sometitle,:mytopic) ";

Good Luck