Hi
Hope someone can help me... I am joining two tables, one of which has a memo field in it. When I try to use odbc_result on that memo field I get the following error:
SQL error: [Microsoft][ODBC Cursor Library] Positioned request cannot be performed because result set was generated by a join condition, SQL state SL002 in SQLGetData in c:\inetpub\wwwroot\customers\test.php on line 23
Code in the page is as follows (comment.comment_content is the memo field):
<?php
ini_set("odbc.defaultlrl", "8192");
$db = odbc_connect("customer", "", "", SQL_CUR_USE_ODBC);
$sql = "select user.user_surname as user_surname, ";
$sql .= "comment.comment_date as comment_date, ";
$sql .= "user.user_forename as user_forename, ";
$sql .= "comment.comment_content as comment_content ";
$sql .= "from user, comment ";
$sql .= "where user.user_id = comment.user_id ";
$sql .= "and comment.project_id = 1 ";
$sql .= "order by comment.comment_date desc";
$rs = odbc_exec($db, $sql);
for($i = 1; $i <= odbc_num_fields($rs); $i++)
{
echo odbc_result($rs, $i) . "<br/>\n";
}
odbc_close($db);
?>
======================
I've been banging my head against this one for ages - any help very gratefully appreciated!!!
(I'm running PHP 4.2.3 on Win2k Pro with Apache 1.3.24)
Thanks
Andy