will35010 Posted June 17, 2009 Share Posted June 17, 2009 I'm trying to echo out a function. I think my syntax is wrong. I've tried a few different ways, but I can't get it working. Any direction would be helpful. The problem line is: <td><div align='center'>MPG: "echo getMpg($row['vin'])"</div></td> while($row = mysqli_fetch_array($query)) { echo "<table width='900' border='1' align='center'> <tr> <td width='225' align='center' scope='col'>VIN: " . $row['vin'] . "</td> <td width='228' align='center' scope='col'>YEAR: " . $row['year'] . "</td> <td width='225' align='center' scope='col'>MAKE: " . $row['make'] . "</td> </tr> <tr> <td><div align='center'>PLATE: " . $row['plate'] . "</div></td> <td><div align='center'>EXPIRE: " . $row['expire'] . "</div></td> <td><div align='center'>MODEL: " . $row['model'] . "</div></td> </tr> <tr> <td><div align='center'>CURRENT MILEAGE: ". $row['mileage'] ."</div></td> <td><div align='center'><a href='lib/forms/oil.php?vin=".$row['vin']."'target='_blank'>Get Oil Info</a></div></td> <td><div align='center'>MPG: "echo getMpg($row['vin'])"</div></td> </tr> </table> </tr> </table>"; } Quote Link to comment https://forums.phpfreaks.com/topic/162583-solved-echo-function-syntax-problem/ Share on other sites More sharing options...
Maq Posted June 17, 2009 Share Posted June 17, 2009 You're already echoing out that entire table, you don't need to echo again. Try: MPG: " . getMpg($row['vin']) . " Quote Link to comment https://forums.phpfreaks.com/topic/162583-solved-echo-function-syntax-problem/#findComment-858081 Share on other sites More sharing options...
will35010 Posted June 17, 2009 Author Share Posted June 17, 2009 You're already echoing out that entire table, you don't need to echo again. Try: <td><div align='center'>MPG: " . getMpg($row['vin']) . "</div></td> Thanks!!! That worked. Quote Link to comment https://forums.phpfreaks.com/topic/162583-solved-echo-function-syntax-problem/#findComment-858084 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.