Build a Website
$10-30 USD
Pagado a la entrega
I have a date combo box which chooses from today and next 6 days. The PHP output is currently set to show only CURRENTDATE data from MySQL My goal is to show data not from CURRENT DATE but from date selected fro ComboBox with Current Date set as the default.
demo page is at: [url removed, login to view]
The PHP code I used is below.
I'd like the output to look similar to:
[url removed, login to view]
Please submit the code I need.
Thanks
<html>
<head>
<title>Connecting MySQL Server</title>
<style>
table,td,th
{
border:1px solid orange;
}
table
{
width:100%;
}
th
{
height:50px;
}
</style>
</head>
<body>
<select name="select" id="select">
<?php
$date = time();
$num_days = 7;
for($i=0; $i<=$num_days; ++$i)
{
$date = mktime(0, 0, 0, date("m") , date("d")+$i, date("Y"));
$date = date('D j M', $date);
echo " <option value='{$date}'>{$date}</option>\n";
}
?>
</select>
<?php
$con=mysqli_connect("localhost","XXXXXXX","XXXXXXX","XXXXXXX");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"
SELECT *
FROM movies2
WHERE date = CURDATE()
");
echo "<table border='2'>
<tr>
<th>Movie</th>
<th>Rating</th>
<th>Time</th>
<th>Date</th>
<th>Code</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td nowrap>" . $row['movie'] . "</td>";
echo "<td nowrap>" . $row['rating'] . "</td>";
echo "<td nowrap>" . $row['time'] . "</td>";
echo "<td nowrap>" . $row['date'] . "</td>";
echo "<td nowrap>" . $row['code'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
</body>
</html>
Nº del proyecto: #5532321
Sobre el proyecto
Adjudicado a:
I would suggest using an li to get the job done, otherwise you'll end up needing javascript. Also your php would need some changing here and there.
4 freelancers están ofertando un promedio de $41 por este trabajo
- I have 7 years work experience in WordPress, Joomla, Drupal, Oscommerce, Woocommerce, Zend, converting PSD to HTML5/CSS3, pure PHP, CSS3, HTML5 & MySQL. I will provide the website with the best quality and on time. Más
<style> table,td,th { border:1px solid orange; } table { width:100%; } th { height:50px; } </style> </head> <body> <select name="select" id="select"> <?php $date = time(); $num_days = 7; for($i= Más