deansaddigh Posted January 4, 2010 Share Posted January 4, 2010 $dateSQL = "SELECT arrival_date, departure_date FROM bookings WHERE client_id = $clientresults('client_id') Order BY id DESC LIMIT 1"; $dateResults = $db->query($dateSQL); ?> <td><?= $dateresults('arrival_date'); ?></td> <td><?= $dateresults('departure_date');?></td> Link to comment https://forums.phpfreaks.com/topic/187112-getting-error-and-i-cant-see-why/ Share on other sites More sharing options...
RaythMistwalker Posted January 4, 2010 Share Posted January 4, 2010 $dateSQL = "SELECT arrival_date, departure_date FROM bookings WHERE client_id = '$clientresults('client_id')' Order BY id DESC LIMIT 1"; $dateResults = $db->query($dateSQL); ?> <td><?= $dateresults('arrival_date'); ?></td> <td><?= $dateresults('departure_date');?></td> I think thats it. From experience i've found that the WHERE something = something else the something else should be in 'something else' Sorry changed to ' i just checked Link to comment https://forums.phpfreaks.com/topic/187112-getting-error-and-i-cant-see-why/#findComment-988115 Share on other sites More sharing options...
JAY6390 Posted January 4, 2010 Share Posted January 4, 2010 I'm guessing your db class has an error reporting feature echo mysql_error(); might do it. If not, check if the class has an error reporting feature echo $db->mysql_error(); Also, might be worth you echoing your sql statement and seeing what it actually says when it's run echo $dateSQL; Link to comment https://forums.phpfreaks.com/topic/187112-getting-error-and-i-cant-see-why/#findComment-988135 Share on other sites More sharing options...
PFMaBiSmAd Posted January 4, 2010 Share Posted January 4, 2010 i cant see why We could probably see the problem easier as well if you actually posted the error message(s.) However, I'll guess it is a php parse error because your array syntax is incorrect. Arrays use [] around the index. You also need to put {} around an array variable when it is inside of a double-quoted string (I also recommend only using full opening <?php tags) - $dateSQL = "SELECT arrival_date, departure_date FROM bookings WHERE client_id = {$clientresults['client_id']} Order BY id DESC LIMIT 1"; $dateResults = $db->query($dateSQL); ?> <td><?php echo $dateresults['arrival_date']; ?></td> <td><?php echo $dateresults['departure_date'];?></td> Link to comment https://forums.phpfreaks.com/topic/187112-getting-error-and-i-cant-see-why/#findComment-988149 Share on other sites More sharing options...
deansaddigh Posted January 4, 2010 Author Share Posted January 4, 2010 Many thanks i figured it out cheers for your help. Link to comment https://forums.phpfreaks.com/topic/187112-getting-error-and-i-cant-see-why/#findComment-988152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.