Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Pontus Bolmér
Pontus Bolmér
12,471 Points

How to get the value from a function returned in to another file, and then write the result in to a csv file!

Hi! Im currently working on a project, where i am writing a function to retrive some data from a database, then what i want to do with the result from my own function is to return the value in to another php file.

What are my options? Is it only to include? I would love some pointers, im sorry if it sounds hazyy

Yours / Pontus

2 Answers

Pontus Bolmér
Pontus Bolmér
12,471 Points

I understand what you mean, i am creating a function that retrevies data from a database, but then i have to include that function in my while loop in another php file!