For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2008 > No resultset with ocibindbyname









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author No resultset with ocibindbyname
Manuel Schölling

2008-02-24, 7:05 pm

Hi guys,

sorry for spamming your mailing list.

I have a strange problem with ocibindbyname():
I use this simple code to start an SQL query:

$sql = "Select * from projekte_generisch where pid=:data";
$conn = oci_connect("secret", "secret", "secret");
$cur = oci_parse($conn, $sql);
my_dump($conn, $cur, $sql);

$pid = "einepid";
my_dump(ocibindbyname($cur, ":data", $pid));
my_dump(oci_execute($cur));

print '<table border="1">';
while ($row = oci_fetch_array($cur, OCI_RETURN_NULLS)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?htmlentities($item):' ').'</td>';
}
print '</tr>';
}
print '</table>';

But this query doesn't give me any data record (no error; empty resultset).

When I use
$sql = "Select * from projekte_generisch where pid='einepid'";
php returns the data record I'm searching for.

What could be the reason? Is there any bug in ocibindbyname or am I
using it the wrong way.

When I use adodb (http://adodb.sf.net) I get the same error:
Using :variable in my query doesn't work but putting the string directly
into the query string it works fine.

What the f*** am I doing wrong?
Any hints are appreciated.

Cheers,
Manuel
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com