Hi all,
First, my code:
function prolite($sql) {
$sql = "SELECT jobID, custID, jobStatus, currentStatus, priLevel, LEFT(complaint, 50) FROM jobs where jobStatus = 'Open'";
$result = mysql_query($sql);
echo "<table>
<tr>
<td>jobID</td><td>custID</td><td>jobStatus</td><td>currentStatus</td><td>priLevel</td><td>complaint</td></tr>";
while($row = mysql_fetch_array($result)){
if($color==1){
echo "<tr bgcolor='#FFC600'>
<td>".$row['jobID']."</td><td>".$row['custID']."</td><td>".$row['jobStatus']."</td><td>".$row['currentStatus']."</td><td>".$row['priLevel']."</td><td>".$row['complaint']."</td>";
$color="2";
}
else {
echo "<tr bgcolor='#C6FF00'>
<td>".$row['jobID']."</td><td>".$row['custID']."</td><td>".$row['jobStatus']."</td><td>".$row['currentStatus']."</td><td>".$row['priLevel']."</td><td>".$row['complaint']."</td>";
$color="1";
}
}
echo '</table>';
This is the function in question. First, the SQL query itself works fine via phpMyAdmin and displays the results the way I need it to (Mainly limiting the character results for the complaint field so I can simply preview the results). However, it's returning the results fine except for the complaint $row, which is simply blank. I suspect it has to do with the "LEFT( complaint, 50 )" part of the mySQL query but I'm stumped as I expected the $row['complaint'] to simply echo back the data but limited.
Anyone see what I'm missing? 😛
Any help would be appreciated.
Peace,
Sean