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 */
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: