php - inserting the data if the column name matches with it -


i trying insert data database. in database have columns this:

mid, 1,2,3,4,5 till 31  

and when user registers (here mid month id 1 12) , take date on day

$date_of_admit=date('y-m-d');        list($year, $month, $day) =explode("-",$date_of_admit); $month = (int)$month; 

now, have insert 'p' day matches, if day 4 should insert 'p' in column 4 . not getting how proceed.

please suggest

updated

$selquery = "select * attendance"; $columnname = mysql_field_name($selquery, $day); 

if can column name can achive couldnt


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -