Hi! so last night I asked is there/how do you do a ocifetchstatement in mysql no one
responded......
so this is what I ended up doing.....
function new_array($array)
{
// get the keys
$array2 = $array;
$keys = array_keys($array2);
// now use the keys to get the values
for($a=0;$a<count($keys);$a++)
{
$the_key = $keys[$a];
$value = $array[$the_key];
// we got the value and the key now lets put em where we want em...
$new_array = array(
"$keys[$a]" => array(
"0" => "$value" )
);
$newer_array = array_merge_recursive($newer_array, $new_array);
}
return($newer_array);
}
function my_data_array($query,$link)
{
global $debug;
tracker($query);
$result = mysql_query($query, $link);
while($rows = mysql_fetch_array($result,MYSQL_ASSOC))
{
if(!$array)
{
$array=new_array($rows);
} else {
$array = array_merge_recursive($array, $rows);
}
}
return($array);
}
it returns an array that is just like the array returned from ocifetchstatement... so
if you are migrating from oracle to mysql and you do not want to rewrite all our
scripts... that use ocifetchstatement.....
try this on for size
:-)
hope this helps someone and err saves them some time...
if anyone has a better way of doing this please send me the code.....
Jimmy Brake
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]