Drop down boxes.. and other stuff..

A

Anonymous

Guest
hello.. again...
Right in my mySQL database, I have fields realting to each month of the year, these show the employee's of the month. I want to be able to select a month from a jump/dropdown menu and it then create a page showing the relative month and employee. How ever on rare occasions the award is shared, don't know if that will make a difference, I'd think not.

My variables are.. 'dotm' - the month
'FirstName' and 'LastName'

please take it slow, as I've mentioned in other posts, I'm still a newbie at this stuff..

cheers
Chris
 
just compare the month value with database date (month)
:?:
 
okee this one must be really easy.. I think it's something to do with my array, but I'm so knackered I can't see it

Error:
Notice: Undefined index: dotm in c:\program files\apache group\apache\htdocs\input page\january.php on line 10


my code is:

Code:
<?
$connection = mysql_connect( "localhost", "root", "belinea" ) or die( mysql_error() ); 
mysql_select_db( "phptest" ) or die( mysql_error() ); 
$id=$HTTP_POST_VARS ["dotm"];  
$result = mysql_query("SELECT FirstName, LastName, dotm FROM test where dotm = '$id';" ) or die( mysql_error() );
while ($row=mysql_fetch_array($result))
echo( "Designer: ".$row["FirstName"] . " " . $row['LastName']);
echo( "Month: ".$row["dotm"]);
?>

and the error is on:

$id=$HTTP_POST_VARS ["dotm"];

any help would be much appriciated..
 
crsk said:
Error:
Notice: Undefined index: dotm in c:\program files\apache group\apache\htdocs\input page\january.php on line 10

...

and the error is on:

$id=$HTTP_POST_VARS ["dotm"];

This would suggest that there's no POST var called "dotm", which would suggest that there's no form field called "dotm". Are you sure you have a form field called "dotm" (double-check your spelling, too)?
 
I think that problem in double quotes.....
for example you may get error than use include and use double quotes too...... :cry:
in builting variables and in include use once quotes.....
and do not use cpace betwin $HTTP_POST_VARS and ['dotm']
to you need this:
Code:
$id=$HTTP_POST_VARS ["dotm"];
replace at this:
Code:
$id=$HTTP_POST_VARS['dotm'];
 
Back
Top