Firslty, please forgive the ineloquent phrasing of my question.
What I am trying to do, is create a simple odbc script, and store it in a file which will be included in my main PHP file several times with different variables.
When including them, I want to specify some variables to pass to it.
My example would be:
Main page
include("table-fields.php?table=sometable");
table-fields.php
$table = $_GET['table'];
odbc_exec(some database function WHERE TBL= $table);
However, if my understanding is correct, as $_GET is global, it would be looking for main.php?table=
Would the better choice be to just set the variable before including, e.g.:
$table = some table;
include("table-fields.php");
table-fields.php
odbc(some database function WHERE TBL= $table);
I want to try and avoid that if possible.
Thanks, Eds
$table = $_GET['table']; odbc_exec(some database function WHERE TBL= $table);should work...include()can actually do both things.