Hi,
I have converted a Mysql database to Oracle9i, and it works fine. (connection works and simple sql queries from php). I think the problem is that I don't know which functions to use with oracle. The following code works with mysql, any ideas how can I get it to work with oracle?
function getlist($query)
{
settype($result,'array');
if (!strlen($query) == 0)
{
$data = mysql_query($query,$link)
or die ('Tietokantahaku epäonnistui!');
while($colum = mysql_fetch_row($data))
{
foreach($colum as $row=>$value)
{
$result[$row][] = $value;
}
}
if(!empty($result));
{
return $result;
} }
I have tried something like this,unsuccesfully:
function getlist($query)
{
array($result);
if (!strlen($query) == 0)
{
$cursor = ora_open($connection);
$data = ora_parse($cursor, $query) or die ('haku ei onnistu');
$data = ora_exec($data);
while($colum = ora_fetch_into($cursor, &$result)) {
{
foreach ($colum as $row=>$value)
{
$result [$row] [] = $value;
}
}
if(!empty($result));
{
return $result;
}
}
I left the connection parameters away from above code, because the problem is not there. I would be grateful for any help.