Jump to content

how to write this select statement


june_c21

Recommended Posts

i just made an event calendar where user can input their event and store in database.  i am stuck with these select statement where i need to pull the data from the database and show it accoring to the date,month,year in the calendar.

 

$query = "SELECT staff_no, eventdate,event FROM calendars ";
  $result1 = mysql_query($query, $dblink);
  while {
}

Link to comment
https://forums.phpfreaks.com/topic/96480-how-to-write-this-select-statement/
Share on other sites

ya, i am using mysql 5

 

$query = "SELECT staff_no, eventdate,event FROM calendars ";
  $result1 = mysqli_query($query, $dblink);
  while {
}

 

i don't know how to write the code in the while loop where it will output the event according to dd,mm,yyyy and link with the calendar i created.

Try this:

 

while ($row = mysqli_fetch_assoc($result1)) {
    ...
}

 

In that while loop you can use $row['staff_no'], $row['eventdate'], and $row['event'] to get those values from the current row in the database you're outputting.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.