note 669 modified in function.odbc-result by felipe
| From: | felipe@php.net | Date: | Tue, 22 Jul 2008 18:45:47 +0000 |
| Subject: | note 669 modified in function.odbc-result by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142515@lists.php.net to get a copy of this message | ||
Beware if you have fields with the same name in a result
<?php
$res = odbc_exec($conn,"select * from PeopleMR,People,Role,Organisation".
" WHERE PeopleMR.MeetingID = $MeetingID" .
" ORDER BY People.Surname");
?>
I have the field "Name" from both TABLE Role and TABLE Organisation, as for MySQL you
would do :
<?php
mysql_result($res,$count,"Role.Name");
mysql_result($res,$count,"Organisation.Name");
?>
but with odbc you do :
<?php odbc_result($res,$count,"Name"); ?>
this gives you the result of TABLE Role "Name" so you have to find the Field Number for
the Organisation"Name" to have the correct result.
--was--
Beware if you have fields with the same name in a result
$res = odbc_exec($conn,"select * from PeopleMR,People,Role,Organisation".
" WHERE PeopleMR.MeetingID = $MeetingID" .
" ORDER BY People.Surname");
I have the field "Name" from both TABLE Role and TABLE Organisation, as for MySQL you
would do :
mysql_result($res,$count,"Role.Name");
mysql_result($res,$count,"Organisation.Name");
but with odbc you do :
odbc_result($res,$count,"Name");
this gives you the result of TABLE Role "Name" so you have to find the Field Number for
the Organisation"Name" to have the correct result.
http://php.net/manual/en/function.odbc-result.php