Hello
I'm experiencing a problem;
I've written a small script where volunteers can be booked for work-activities at a festival.
The festival has 5 different departments so i've created a database-table named "COORDINATO R" where all 5 usernames, password (md5 protected) and short description of the departments are located.
When a volunteer is getting booked by a certain festivaldepartm ent, the earlier mentioned description of the department should be added to a SIGNUP table so its easy to see for everyone where a certain volunteer will work at the festival (behind a bar, or building the stage etc..)
To get the right department-description, I use the username that is used at the current session.
But...when I query the code, I get an error. The third query gives me an error ("Mysql Error 3") back but i don't see why.
As far as I see..the code should be working :/ (I used lowercase fieldnames in the COORDINATOR table by the way)
Part of the code;
[php]
<?
// Check Login
if($logged_in){
echo 'Logged in as '.$_SESSION["username"].', <a href="logout.ph p">logout</a>';
// Get ID Of Volunteer From The Previous Page
$VRIJWILLIGER_I D = $_GET["id"];
// Query Details Of Volunteer
$query = "SELECT VOLUNTEER_ID, FIRSTNAME, LASTNAME, ADDRESS, ZIPCODE, CITY, TELEPHONE, AVAILABLE FROM VOLUNTEER
where VOLUNTEER_ID = $VOLUNTEER_ID";
$result = mysql_query($qu ery)
or die("Mysql Error 1");
// Query Amount Of Days That The Volunteer Is Available For Work
$query = "SELECT DAYS FROM SIGNUP
where VOLUNTEER_ID = $VOLUNTEER_ID";
$result_days = mysql_query($qu ery)
or die("Mysql Error 2");
// Assign The Username From The Session To Loginname
$loginname = $_SESSION["username"];
// Get The Right Username Using The Loginname
$query = "SELECT description FROM COORDINATOR
where username = $loginname";
$result_usernam e = mysql_query($qu ery)
or die("Mysql Error 3");
[/php]
I'm experiencing a problem;
I've written a small script where volunteers can be booked for work-activities at a festival.
The festival has 5 different departments so i've created a database-table named "COORDINATO R" where all 5 usernames, password (md5 protected) and short description of the departments are located.
When a volunteer is getting booked by a certain festivaldepartm ent, the earlier mentioned description of the department should be added to a SIGNUP table so its easy to see for everyone where a certain volunteer will work at the festival (behind a bar, or building the stage etc..)
To get the right department-description, I use the username that is used at the current session.
But...when I query the code, I get an error. The third query gives me an error ("Mysql Error 3") back but i don't see why.
As far as I see..the code should be working :/ (I used lowercase fieldnames in the COORDINATOR table by the way)
Part of the code;
[php]
<?
// Check Login
if($logged_in){
echo 'Logged in as '.$_SESSION["username"].', <a href="logout.ph p">logout</a>';
// Get ID Of Volunteer From The Previous Page
$VRIJWILLIGER_I D = $_GET["id"];
// Query Details Of Volunteer
$query = "SELECT VOLUNTEER_ID, FIRSTNAME, LASTNAME, ADDRESS, ZIPCODE, CITY, TELEPHONE, AVAILABLE FROM VOLUNTEER
where VOLUNTEER_ID = $VOLUNTEER_ID";
$result = mysql_query($qu ery)
or die("Mysql Error 1");
// Query Amount Of Days That The Volunteer Is Available For Work
$query = "SELECT DAYS FROM SIGNUP
where VOLUNTEER_ID = $VOLUNTEER_ID";
$result_days = mysql_query($qu ery)
or die("Mysql Error 2");
// Assign The Username From The Session To Loginname
$loginname = $_SESSION["username"];
// Get The Right Username Using The Loginname
$query = "SELECT description FROM COORDINATOR
where username = $loginname";
$result_usernam e = mysql_query($qu ery)
or die("Mysql Error 3");
[/php]
Comment