mattia Posted July 13, 2012 Report Share Posted July 13, 2012 Hi I wrote this code to get the hours of a pilot on a single airplane in profile_stasts.tpl but don't work <?php $query = 'SELECT flighttime FROM '.TABLE_PREFIX.'pireps WHERE aircraft = 6 AND pilotid = '.Auth::$userinfo->pilotid'; --------------->I believe that the error is here $result=DB::get_row($query); echo $result->distance; { } ?> Can you help? many thanks Regards Quote Link to comment Share on other sites More sharing options...
SouthwestVA Posted July 13, 2012 Report Share Posted July 13, 2012 <?php $query = 'SELECT flighttime FROM '.TABLE_PREFIX.'pireps WHERE aircraft = 6 AND pilotid = '.Auth::$userinfo->pilotid.'; $result=DB::get_row($query); echo $result->distance; { } ?> you for got a . i think try that. Quote Link to comment Share on other sites More sharing options...
mattia Posted July 13, 2012 Author Report Share Posted July 13, 2012 what? sorry but I did not understand Quote Link to comment Share on other sites More sharing options...
SouthwestVA Posted July 13, 2012 Report Share Posted July 13, 2012 AND pilotid = '.Auth::$userinfo->pilotid'; that part, to echo inside of a php code its '.xxx.' you for got the 2nd dot It should be this: AND pilotid = '.Auth::$userinfo->pilotid.'; Quote Link to comment Share on other sites More sharing options...
mattia Posted July 13, 2012 Author Report Share Posted July 13, 2012 dont work this error Parse error: syntax error, unexpected T_LNUMBER in /var/www/virtual/italianivolanti.it/htdocs/iv/core/templates/profile_stats.tpl on line 27 Quote Link to comment Share on other sites More sharing options...
SouthwestVA Posted July 13, 2012 Report Share Posted July 13, 2012 <?php $query = 'SELECT flighttime FROM '.TABLE_PREFIX.'pireps WHERE aircraft = '6' AND pilotid = '.Auth::$userinfo->pilotid.'; $result=DB::get_row($query); echo $result->distance; { } ?> try that Quote Link to comment Share on other sites More sharing options...
mattia Posted July 13, 2012 Author Report Share Posted July 13, 2012 works many thanks Quote Link to comment Share on other sites More sharing options...
SouthwestVA Posted July 13, 2012 Report Share Posted July 13, 2012 no problem Quote Link to comment 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.