So I got this project to take a page that was previously using MySQL and now using Oracle. So I installed the oci8 PHP module and created a test page to make my changes on. This is a page I am updating and I am not an Oracle guy. I am a MySQL/PostgreSQL guy.
Anyway, there are these original parameters:
$webIndex = mysql_db_query('main', 'SELECT * FROM links2');
while ($garbage = mysql_fetch_array($webIndex)) {
$descriptions = $garbage['descr'];
$urls = $garbage['url'];
print "<a href=\"$urls\">$descriptions</a><br />";
$i++;
}
So I replaced the lines as follows:
$webIndex = oci_parse('main', 'SELECT * FROM links2');
while ($garbage = oci_fetch_array($webIndex)) {
$descriptions = $garbage['descr'];
$urls = $garbage['url'];
print "<a href=\"$urls\">$descriptions</a><br />";
$i++;
}
Upon doing this, tailed -f the apache error log and got:
[Thu Jan 02 14:41:24 2014] [error] [client 10.10.102.75] PHP Warning: oci_parse() expects parameter 1 to be resource, string given in /srv/www/htdocs/db/index-woods.php on line 15
[Thu Jan 02 14:41:24 2014] [error] [client 10.10.102.75] PHP Warning: oci_fetch_array() expects parameter 1 to be resource, null given in /srv/www/htdocs/db/index-woods.php on line 17
[Thu Jan 02 14:41:24 2014] [error] [client 10.10.102.75] PHP Notice: Undefined variable: pageText2 in /srv/www/htdocs/db/index-woods.php on line 105
[Thu Jan 02 14:41:24 2014] [error] [client 10.10.102.75] PHP Notice: Undefined variable: pageText3 in /srv/www/htdocs/db/index-woods.php on line 106
The last two errors are related to the first two. Based on these errors, it appears that oci_parse
and oci_fetch_array
are incorrect. These are lines 15 and 17 BTW.
Once again I do not know Oracle...