Am I able to use an indexer from PHP?
1 post
• Page 1 of 1
Am I able to use an indexer from PHP?
The IDataReader interface allows an implementer to create an indexer for the implementation that is able to return a field value for a named field. In C# this might be:
string value = (string)reader"fieldname";
If a similar syntax is used in PHP Phalanger rightly warns that $reader is being used as an array and fails to return any value.
Of course in this example, the workaround is to use the GetOrdinal("field") and GetString($pos) methods of the reader class. This is a fairly cumbersome way to retrieve resultset values and the indexer will be much more elegant. What syntax should I use? Are indexers supported? I've looked through the PDF files and have been unable to see anything relating to indexers.
Edit: I've just see message 1617 which indicates indexers are TDB. Is this feature still to be done?
Bill Seddon
string value = (string)reader"fieldname";
If a similar syntax is used in PHP Phalanger rightly warns that $reader is being used as an array and fails to return any value.
Of course in this example, the workaround is to use the GetOrdinal("field") and GetString($pos) methods of the reader class. This is a fairly cumbersome way to retrieve resultset values and the indexer will be much more elegant. What syntax should I use? Are indexers supported? I've looked through the PDF files and have been unable to see anything relating to indexers.
Edit: I've just see message 1617 which indicates indexers are TDB. Is this feature still to be done?
Bill Seddon
- bseddon@codeplex
- Posts: 13
- Joined: January 7th, 2012, 8:52 pm
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests