Jump to content

Help with this function ... or EngInSite editor!


Johnain

Recommended Posts

I have got a function that the EnginSite Editor/Debugger is failing on a given line.

 

I cannot for the life of me work out why, and the debugger has decided that is not going to accept breakpoints today (no idea why, it did yesterday). It has also decided that it's too tired to evaluate statements or to give values on watchpoints, poor labm ! There is no help to be got at EngInSite, they are not answering e-mails at the support desk.

 

This is the function ....

 

function getgentext($textref, $langue, $text) {

// $textref is the reference of the text - NOT the row id in the table

// $sessionlangue is the language

// $text is to identify which text is returned

//    1 = long text

//    2 = medium text

//    3 = short text

//    4 = Column header text

 

 

$sql = "SELECT * FROM peri_othertexts where textref = $textref and langue = $langue ;

$result = mysql_query($sql) or die('SQL Query failed ... ' . mysql_error());     

$num_rows = mysql_num_rows($result);

$rowcontent = mysql_fetch_row($result)

 

switch($num_rows) {

  case 0 :

      switch($langue) {

        case 'FR' :

          $retval = 'Texte non disponible';

          break;

        case 'EN' :

          $retval = 'Text not available';

          break;

        default :

          $retval = 'Text not available';

      }       

  default:

    switch($text) {

      case 1:

        $retval =  $rowcontent['textlong'] ;

        break;

      case 2:

        $retval =  $rowcontent['textmed'] ;

        break;

      case 3:

        $retval =  $rowcontent['textshort'] ;

        break;

      case 4:

        $retval =  $rowcontent['textcolhead'] ;

        break;

      default:

        $retval =  $rowcontent['textlong'] ;

        break;

    }   

}     

 

return $retval ;

}

 

The highlighted line is the one that gets this message

 

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\htdocs\perigordirect\includes\db_lib.php on line 45

PHP Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\htdocs\perigordirect\includes\db_lib.php on line 45

 

But clearly there is a record found, or else it would have taken case 1 of the $num_rows switch.  I have checked and there is data there.

 

Cheers

 

John

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.