I'm currently working on my computing project which would allow a user to create an indefinite amount of files. What I'm currently stuck on is retrieving these values to let a user select one here is my code:
function DispMonth(){
$dateList=GetDates($_Session['user']);//use session id
foreach($dateList as $value){//get each value
echo '<tr>' .$value.'</tr>';}
}
?>
<body>
<table>
<th><tr> Made Budgets</tr> </th>
<?php DispMonth(); ?>
</body>
</html>
My GetDates function is:
function GetDates($id){
$result=mysql_query('select monthYear from database where userId='.$_Session['user'].'');
while ($row=mysql_fetch_object($result)){
$x[]=$row['monthYear'];}
return x;
}
Essentially I would like the table to look something like this:
|monthYear| edit | delete |
With edit and delete being links/buttons which would send the value of monthYear to a new php page to fetch all the values.(Monthyear is a primary key in my sql table)