There is a code that adds data from the database to the table.

if (isset($_GET['id']) AND (intval($_GET['id']) != '')) { $id = intval($_GET["id"]); $s = mysql_query("select afisha_text from i_block_elements where id='" . $id . "' and version='" . $lang . "' limit 1"); $r = mysql_fetch_array($s); if (mysql_num_rows($s) > 0) { echo '<div>' . str_replace('\"', '"', $r["afisha_text"]) . '</div>'; } } else { $id = 22; $s = mysql_query("select * from i_block_elements where id_section='" . $id . "' and version='" . $lang . "' ORDER by afisha_sort asc"); echo '<table>'; if (mysql_num_rows($s) > 0) { while ($r = mysql_fetch_array($s)) { if ($r["afisha_prem"] == 1) { $prem = '<span style="font-style:italic">Премьера!</span><br />'; } else { $prem = ''; } echo ' <tr> <td style="padding:10px; width:100px; border:1px solid #ccc">' . $r["afisha_date"] . '</td> <td style="padding:10px; width:70px; border:1px solid #ccc"">' . $r["afisha_time"] . '</td> <td style="padding:10px; border:1px solid #ccc""> ' . $prem . ' <a style="line-height:24px;" href="/ru/afisha.php?id=' . $r["id"] . '">' . str_replace('\"', '"', $r["afisha_name"]) . '</a> <br />' . str_replace('\"', '"', $r["afisha_anounce"]) . ' </td> </tr> '; } } echo '</table>'; } 

How to make the weekend sat and sun stand out yellow?

  • Try to insert if (date ("l", variant_date_to_timestamp ($ r ["afisha_date"] == "Saturday") {// other code)
  • What the hell is this? Why can not edit your comments? :( - zenith
  • and to add yellow data to this table? - psix

1 answer 1

Probably not smart to say, but I will. As in purely through MySQL, I don `t know the day of the week, but you can skip the value through the PHP function getdate () and find out the day of the week, and then solder the style further.