thanks xenon, I didn't knew the mysql_result function... its very helpful!
It makes things easier, but I still dont know how to pass data between layers (or tiers). I mean, I dont want to send to the business layer a result from mysql_query. I would like to send any kind of array or data structure that dont have anything to do with the data access.
For example if I get 50 rows of student data, I dont want to send the result from mysql_query to the function that writes a log and to the template engine (like smarty). I want to send something like the asp's DataSet, which is completely database independent and disconnected.
In the case of 'student' I write a class (class Student) with name, code, age... and after that, I make an array of student objects (each one with the data of a row). The array is the thing that I send to the rest of the application. It works fine for me, but I feel it is not an elegant solution (and it is not so flexible and scalable!).
And I've been always in love with php. I just had a crush on asp.net, but I'm with php again. I just miss the 'pure oop feeling' of asp.
If there's any pear package or class library that would help me, please let me know, and if others handle this problem with other techniques pleasme let me know
Thanks