If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Yep that should work in the newer versions of PHP.
It won't work in older (and I'm talking like 5.3 here as older, but I'm not 100% sure when it was implemented). The reason is that PHP wasn't designed until very recently to allow dereferencing of the return of a function / method call, only on assigned zval's themselves. So this wouldn't work in older versions. The work around is very easy, which I'd suggest doing at least for the time being anyway:

PHP Code:

$oField = $result->fetch_field_direct($i);print $oField->name;

'name' is the aliased name if it has been aliased, while orgname would be the actual name of the property in the dbms.

MySQLi also has the fetch_fields method on the mysqli_result object which returns an array of objects representing each fields. Its the same as the fetch_field_direct except the direct asks which field you want.

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)