[PHP]$query = "select * from jobs where user_id = '".$_SESSION['user_id']."'";
$result = @mysql_query ($query);
$num = mysql_num_rows( $result);
if ($num >0)
{
echo "<tr><th colspan='2' width='100%' align='left'>Jo b Position</th></tr>";
while ($row = mysql_fetch_arr ay($result, MYSQL_ASSOC))
{
$job_position = stripslashes($r ow['job_position']);
$id = $row['id'];
$submitted = $row['submitted'];
echo "
<tr>
<td width='50%'><fo nt face=arial size=2><!--$id-->$job_positio n</a></font></td>
<td width='50%'><fo nt face=arial size=2>Current Status:
";
if ($submitted > SUBDATE(NOW(), INTERVAL 30 DAY))
{
echo "Expired";
}
else
{
echo "Active";
}
echo "
</td>
</tr>";[/PHP]
I'm getting an error message "unexpected T_LNUMBER " with this if statement. $submitted is the date the ad was created, ads created within 30 days is considered active and ads over 30 days are expired.
I've read that you cannot start a variable with a number, so how can I do this?
$result = @mysql_query ($query);
$num = mysql_num_rows( $result);
if ($num >0)
{
echo "<tr><th colspan='2' width='100%' align='left'>Jo b Position</th></tr>";
while ($row = mysql_fetch_arr ay($result, MYSQL_ASSOC))
{
$job_position = stripslashes($r ow['job_position']);
$id = $row['id'];
$submitted = $row['submitted'];
echo "
<tr>
<td width='50%'><fo nt face=arial size=2><!--$id-->$job_positio n</a></font></td>
<td width='50%'><fo nt face=arial size=2>Current Status:
";
if ($submitted > SUBDATE(NOW(), INTERVAL 30 DAY))
{
echo "Expired";
}
else
{
echo "Active";
}
echo "
</td>
</tr>";[/PHP]
I'm getting an error message "unexpected T_LNUMBER " with this if statement. $submitted is the date the ad was created, ads created within 30 days is considered active and ads over 30 days are expired.
I've read that you cannot start a variable with a number, so how can I do this?
Comment