Quote:
|
how to I initiate the specific database?
|
I think that a bit of semantic is needed here, to all speak about the same thing.
First, you have the database server.
A database server can hold several databases, depending of the hard disk size allocated for them.
The databases server can contain several databases. A database is a logical entity, that holds a set of datas.
In a database, you have tables.
A table is the container of informations, where you define which column will hold which type of informations.
In that table, you will record, update or deletes rows, or records.
So, when you ask
Quote:
|
how to I initiate the specific database?
|
, I presume that you ask
Quote:
|
How does the site knows which tables to use?
|
.
And the answer is : It don't know.
It's up to you to explain in every details what the server should do of which datas, how to handle them and what to do with them.
Expanding what Stoot told you, you have to get back the information passed in the url (the GET parameter) that specify which user to load:
PHP Code:
<?php
if (isset($_GET['schoolId'])){
$schoolId=trim(addslashes($_GET['schoolId']));
}
else{
//we detect that no school id is given
$schoolId=FALSE;
}
if ($schoolId!==FALSE){
//we only do something on the db it the id is passed
$q="select * from table where schoolId=$schoolId";
$res=mysql_query($q);
while($obj=mysql_fetch_object($res)){
//we receive the row from the db, and use it
$html=<<<html
School informations:<br/>
name:{$obj->name}<br/>
address:{$obj->address}<br/>
city:{$obj->city}<br/>
<hr/>
html;
echo $html;
}
}
else{
echo "you haven't specified any shool.";
}
And this, will display the name, address and city (imaginary fields, of course) from the db if a shoolId parameter is given.
If no schoolid parameter is given, a simple message is displayed to the user.
You have a starting point, now you have to determine exactly what to do with your page.