How can I properly describe the dollar sign in PHP ->> v$parameter
$sysparm = ("select * from v'$'parameter"); <-- First attempt
PHP Warning: oci_execute(): ORA-00933: SQL command not properly ended in /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php on line 15
PHP Stack trace:
PHP 1. {main}() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:0
PHP 2. oci_execute() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:15
PHP Fatal error: Could not execute statement: ORA-00933: SQL command not properly ended in /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php on line 18
PHP Stack trace:
PHP 1. {main}() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:0
PHP 2. trigger_error() /var/apache2/2.2/cgi-bin/oracle-master-sysparms.php:18
oradba@solaris-slave:/var/apache2/2.2/cgi-bin$
==============================================================
CODE
==============================================================
<?php
$sysparm = ("select * from v'$'parameter");
$conn = oci_connect('system', 'welcome1', 'solaris-master:1521/x86artsdb');
if (!$conn) {
$m = oci_error();
trigger_error('Could not connect to database: '. $m['message'], E_USER_ERROR);
}
$s = oci_parse($conn, $sysparm);
if (!$s) {
$m = oci_error($conn);
trigger_error('Could not parse statement: '. $m['message'], E_USER_ERROR);
}
$r = oci_execute($s);
if (!$r) {
$m = oci_error($s);
trigger_error('Could not execute statement: '. $m['message'], E_USER_ERROR);
}
$r = oci_fetch_all($s, $res);
if (!$r) {
$m = oci_error($s);
trigger_error('Could not fetch rows: '. $m['message'], E_USER_ERROR);
}
echo "<table border='3'>\n";
foreach ($res as $row) {
echo "$r";
echo "<tr>\n";
foreach ($row as $item) {
echo " <td>".($item!==null?htmlentities($item,
ENT_QUOTES):" ")."</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
?>
===========================================================