Im trying to do a script for making select queries to my database. At the moment it looks like this:
Code: Select all
<?php
$results = array();
$statement = ociparse($link, $query);
ociexecute($statement);
$numCols = ocinumcols($statement);
$row = array();
for($i=0; $i<$numCols; $i++)
{
$row[ocicolumnname($statement, $i)] = ociresult($statement, $i);
var_dump($row[ocicolumnname($statement, $i)]);
}
array_push($results,$row);
while(ocifetch($statement)){
$row = array();
for($i=0; $i<$numCols; $i++){
$row[ocicolumnname($statement, $i)] = ociresult($statement, $i);
}
array_push($results,$row);
}
?>"select count(*) AS COUNT from sometable where attribute='$attribute'"
it doesnt fill in the array with anything at all... Any suggestions?
Regards
Morten
[Edit: Added PHP tags for eyecandy. --JAM]