Jump to content

GrahamMercer

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by GrahamMercer

  1. I am getting the following error message

    SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by RaceSetupID' at line 1 SQL errno: 1064 SQL: select * from hesketh_racesetups where IndividualRaceID = order by RaceSetupID

     

    The offending line of code is

     

    $sql = "select * from xxxxxxx_racesetups where IndividualRaceID = $mrid order by RaceSetupID";

     

    ($mrid is previously set by the line $mrid = $row->IndividualRaceID;)

     

    Thanks for any help that can be offered :)

    Graham

  2. Hi and first of all thanks to everyone here that takes the time to help out newbies such as myself. :) I have a conditional IF statement that allows me to add a link to a piece of text if that record has a website, but I would like to also be able to display the text without the link if there is no website associated with the record.The code that I am currently using is

     <?php if($row_RSsales['website']!='') { ?><a href="<?php echo $row_RSsales['website']; ?>" target="_blank"><?php echo $row_RSsales['name']; ?></a><?php } ?>

    The trouble with this is that if a particular record does not have a website then the code does not echo the business name. I would like to include an ELSE statement with the IF statement so that when a record does not have a website entry the business name is still echoed, but not hyperlinked.I have been fiddling with code but cannot figure out how to do it.

     <?php if($row_RSsales['website']!='') { ?><a href="<?php echo $row_RSsales['website']; ?>" target="_blank"><?php echo $row_RSsales['name']; ?></a>;else <?php echo $row_RSsales['name']; ?><?php } ?>

    doesn't work and I am not sure how to solve it.Any suggestions would be greatly appreciated!thanks,Graham :)

×
×
  • Create New...