
How can I make those dates line up with start date and end date or selectively echo the dates rather than have the while loop echo them?
For example if I can echo “Start Date” then the actual date then the “end date” and then the date.
Basically how may I echo the dates from mySQL selectively rather than using the loop to echo them?
for example if I want to echo row 2 can I do echo $row‘date’ (to echo the 2nd row)
On HTML Page PHP CODE:
Start Date:
End Date:
<?php
mysql_connect("host","username","password") or die(mysql_error());
mysql_select_db("UserLogins") or die(mysql_error());
$query = "SELECT * FROM Date1";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<li>".$row['date']."</li>";
echo "<br />";
}
?>
first solution
second solution
if you want to use second solution remember to put index on
datecolumn