?
Solved

One Big PHP script or several small ones

Posted on 2010-08-13
2
Medium Priority
?
309 Views
Last Modified: 2013-12-13
I am new to programming, but here it goes. I am building a flex web application that connects to a mysql database using PHP. I currently use two diffrent styles to send data back and forth, Http Service & the built in data services. I find that Http service is by far the easiest way to go for me, but I have run into a situation Im not sure about. Would it be better to have a few big PHP files with a lot of code in them, or several smaller php files that have the diffrent services broken up.

For instance if i have table A & table B in my database i could make one php file for each table or should I combine them and use a bunch of if commands.  

Either way would work for me I am just looking for best practices.
0
Comment
Question by:cardilion
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 13

Accepted Solution

by:
p_nuts earned 500 total points
ID: 33432800
have a look at classes and functions... for example I use a mysql class and a table class they deliver the content ... I just create a query and call the classes.. if I don't want a table but a list I can just change 1 line.

so multiple files yes. short functions in object oriented classes yes.

inline script as little as possible. try to make functions you can re-use
0
 
LVL 13

Expert Comment

by:p_nuts
ID: 33432996
have a look at classes and functions... for example I use a mysql class and a table class they deliver the content ... I just create a query and call the classes.. if I don't want a table but a list I can just change 1 line.

so multiple files yes. short functions in object oriented classes yes.

inline script as little as possible. try to make functions you can re-use
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question