<?php
$hostname = "localhost";
$username = "root";
$password = "*******";
$usertable = "tblemployment";
$dbname = "mastercut";
$today = getdate();
mysql_connect($hostname,$username,$password) or die("Unable to connect to database");
mysql_select_db( "$dbname") or die( "Unable to select database");
$query = "SELECT * FROM $usertable WHERE jobtitle IS NOT NULL";
$result = mysql_query($query);
$number = mysql_num_rows($result);
$i = 0;
if($number == 0):
print "<center>Sorry, we do not have any current job openings available ";
print "for $today[month] $today[year].</center>";
elseif($number > 0):
print "<center>Jobs currently available as of $today[month] $today[year] <br><br><br><br>";
while ($i < $number):
$jobtitle = mysql_result($result,$i,"jobtitle");
$jobdescription = mysql_result($result,$i,"jobdescription");
$dateadded = mysql_result($result,$i,"dateadded");
print "$jobtitle ";
print "$jobdescription ";
print "$dateadded ";
$i++;
endwhile;
endif;
I tried using a <tr> tag in a loop all I got was one row that was rewritten over and over again. This is what I have as of now. I am thinking it has to be during the print statements I will need some sort of conditional looping.
Thanks in advance,
Shanis