944,001 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1507
  • PHP RSS
Mar 29th, 2006
0

question about an include file

Expand Post »
I have to write an include file for this independent study thing I am doing, since my boss doesn't feel that mysql stored procedures are enterprise-ready yet. This include file will, among other things, interface with the database that I designed.

Is there anything I should know before doing this? Links and/or your personal opinions would be nice.
Similar Threads
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
hinde is offline Offline
60 posts
since Jul 2005
Apr 4th, 2006
0

Re: question about an include file

It sounds like you want to use an include file to store your SQL statement. You can just assign the SQL statment to a variable as a string in the include file. As in:

[PHP]$sql = "SELECT col_1, col_2, col_3 FROM filename WHERE id=3";[/PHP]
If security is the major concern, you should place the include files outside the Web tree. In other words, above the root directory for your site. Most servers have a tmp directory or something similar that you can use to store these types of files. The important part is that it should not be part of the Web site tree and therefore will not be accessible to others.

To call the include file, just fully specify the path to the file as in:

[PHP]require_once '/home/mysite/tmp/sql01.php';[/PHP]
If you do not know the server path to a directory outside of the Web tree, just ask your Webmaster or hosting company.
Reputation Points: 15
Solved Threads: 5
Junior Poster in Training
TopDogger is offline Offline
87 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Looking for an Asset Tracking system
Next Thread in PHP Forum Timeline: Best method to randomize image





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC