Jump to Navigation

005 - To connect Oracle 10g XE

<?php
/* oci_fetch_all example */

$conn = oci_connect("hr", "hr", "localhost");

$stmt = oci_parse($conn, "select * from employees");

oci_execute($stmt);

$nrows = oci_fetch_all($stmt, $results);
if ($nrows > 0) {
echo "<table border=\"1\">\n";
echo "<tr>\n";
foreach ($results as $key => $val) {
echo "<th>$key</th>\n";
}
echo "</tr>\n";

Oracle:

004 - Comparison Operators

== Equals True if $a is equal to $b
=== Identical True if $a is equal to $b and of the same Type
!= Not equal True if $a is not equal to $b
<> Not equal True if $a is not equal to $b
!== Not Identical True if $a is not to $b of if they are not of the same type

003 - GET and POST

* $_POST
You can only use this in HTML form. This method takes the data from the form field and sends it through an HTTP header. The data cannot be seen in the URL(For much data, a lot of values.).

* $_GET
This method gets the data from the form fields, encodes it, and adds it to the destination URL (For one value).

001 - mysql_connect() and mysql_pconnect()

There is a difference between mysql_connect() and mysql_pconnect().

* mysql_connect()
This opens a connection to a MySQL Server. The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close().

MySQL:

002 - About require(),include(),include_once()

* require():
If there is an error pf "missing a file", this statement immediately stop processing, but include() does not behave this way, the PHP script will continue regardless.

* include():
This statement includes and evaluate the specified file during the execution of the script. If not found a file, the script will continue.

Pages

Subscribe to LAMP, Database and Cloud Technical Information RSS


Main menu 2

by Dr. Radut