Problems with ora_bind

admin

Administrator
Staff member
I'm having a bit of trouble figuring out how to make ora_bind work for me and was wondering if someone can tell me what I'm doing wrong.

here's a snippet of something similar to what I have so far:

$bindvars = array(":start"=>"0123");
$query = "select blah from database where uid >= :start";
ora_parse($Cursor_ID, "$query");
if (is_array($bindvars)) {
while (list($key, $value) = each($bindvars)) {
$len = strlen($value);
ora_bind($Cursor_ID, substr($key, 1) , $key, $len);
$keyid = substr($key, 1);
$$keyid = $value;
}
}

ora_exec($Cursor_ID);
while (ora_fetch_into($Cursor_ID, &$temp, ORA_FETCHINTO_NULLS)) {
$return[]= $temp;
}

if I make the query without the bind and just use regular variables everything works as expected. When I use the bind vars nothing is returned and no errors occur.. I'm desperate for a solution on this one because the database is getting killed with cpu from parsing queries like this. Any thoughts????
 
Back
Top