Jump to content

Recommended Posts

Hi all,

 

I am developing a CMS sort of website and during the planning I can see that I will be using a lots of variations of $sql and $results in previous websites I have just re-typed the whole script on every PHP page where they were needed.

 

To keep the scripts a bit tidier this time, I was hoping to get some advice as to the best way to use/manage them.

 

E.g. Should I copy and paste the $sql codes in every PHP page?

      Should I create a functions.php page and include all the variations of $sql that I will be using all call for them when needed?

      Or Should I go about it another way!?

 

Thanks for any advice.

Link to comment
https://forums.phpfreaks.com/topic/220255-advice-using-sqls-frequently/
Share on other sites

I have not written a line of code yet.

 

Can you tell me moire about classes to handle SQL - never heard of this - I am an advanced beginner!

 

Thanks

 

If you Google for this topic (PHP sql database class) then you will find many examples.  If you have specific questions I will be more than happy to help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.