Is it correct to use one view file with say 2 functions inside it.
For example I have project table in my database and I have 2 functions inside the view file for this specific MySQL query.
Each query returns a specific view so say
function 1 = num_rows function 2 = data inside the rows
Would this be correct or should I do something different ?
Your View Files should not have functions in them.
The idea of MVC is to separate the Model, e.g. everything not related to presentation from the presentation layer (represented by V and C). M should be oblivious to V and C.
The controller handles any input to the presentation layer / the User interface. It delegates to the Model and sets anything the Model returns to the View.
The View is in charge of rendering your Model data and User Interface. If you need to have functions in the View, those are best kept in View Helpers.
See the Web Presentation Patterns in PoEAA for some ideas about how to best render the View. Parts of the book are available on Google Books.
This type of functions doesn't belong into the view. The only Code that belongs into views is Code required for structuring the data.
This kind of functions belongs to the model, because it works on the data.
Perhaps you should take a look at the Model–view–controller Article on Wikipedia (http://en.wikipedia.org/wiki/Model–view–controller) to get a better understanding of MVC.
Sory, for some reason I can't make a real link to the wiki page.