note 16119 added to ref.oci8
| From: | b-sept at gmx dot de | Date: | Wed, 17 Oct 2001 05:27:23 +0000 |
| Subject: | note 16119 added to ref.oci8 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-19022@lists.php.net to get a copy of this message | ||
I have to convert a mySql database to a Oracle one. Can someone tell me,
what is the equivalent code to the one below? Or where do I have to take attention because of
differences in the philosophy of mySql and Oracle?
Thanks, Bernd
x-------------
$MySQL_Host="db.host.de";
$MySQL_User="sqlUser";
$MySQL_Passw="password";
$db="sqlDataBase";
if (! @$cc=mysql_connect("$MySQL_Host","$MySQL_User","$MySQL_Passw"))
{
echo "Something went wrong in the connection to ",$MySQL_Host," <br>";
exit;
}
x------------------------
function connect() {
global $MySQL_Host, $MySQL_User, $MySQL_Passw;
if (!
$linkid=mysql_connect("$MySQL_Host","$MySQL_User","$MySQL_Passw")) {
echo "Something went wrong in the connection to ",$MySQL_Host," <br>";
exit;
}
return $linkid;
}
function createdb($db, $lkid) {
if (! $res=mysql_create_db($db, $lkid)) {
echo mysql_error($lkid);
exit;
}
return $res;
}
function send_sql($db, $sql) {
if (! $res=mysql_db_query($db, $sql)) {
echo mysql_error();
exit;
}
return $res;
}
function tab_out($result) {
$anz=mysql_num_fields($result);
echo "<table width=90% border=0 cellpadding='2'
cellspacing='2'>";
echo "<tr bgcolor=#D0D0D0>";
for ($i=0;$i<$anz;$i++){
echo "<th>";
echo mysql_field_name($result,$i);
echo "</th>";
}
echo "</tr>";
echo "<tr>";
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
foreach ($row as $elem) {
echo "<td bgcolor='#E8E8E8' valign='top'><font
size='-1'>$elem</font></td>";
}
echo "</tr>";
}
echo "</table>";
} // tab
--
http://www.php.net/manual/en/ref.oci8.php
http://master.php.net/manage/user-notes.php?action=edit+16119
http://master.php.net/manage/user-notes.php?action=delete+16119
http://master.php.net/manage/user-notes.php?action=reject+16119