This is a code for my radio station schedule, which works well, no error messages:
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","root","PASSWORD");
//select which database you want to edit
mysql_select_db("radio1");
//select the table
$result = mysql_query("select * from schedule order by ID");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$image=$r["image"];
$airtime=$r["airtime"];
$show=$r["show"];
$showinfo=$r["showinfo"];
$showinfo1=$r["showinfo1"];
echo "
<li class=''>
<h4><span>$airtime</span> $show</h4>
<p>$showinfo</p>
<a href='http://' class='more'>More about $showinfo1</a>
$image
</li>";
}
?>
However, what I'm trying to achieve with the <li> bit is like this:
<li class="">
<h4><span>MIDNIGHT</span> <a href="http://">Presenter1</a></h4>
<p>Description</p>
<a href="http://" class="more">More about Presenter1</a>
<img src="http://" alt="Image" />
</li>
<li class="alt"><h4><span>6:00 AM</span> <a href="presenter2.php">Presenter2</a></h4>
<p>Description</p>
<a href="http://" class="more">More about Presenter2</a>
<img src="http://" alt="Presenter2" />
</li>
yet I am not sure how to do this in the above file (which, by the way, is included in my radio station schedule pages).
How would I be able to do it so it was
li class=
then
li class="alt"
like the example above within my echo statement?
All help is appreciated - I have tried to do this, but can't figure out how to get it to work!