Link to home
Start Free TrialLog in
Avatar of narmi2
narmi2

asked on

PHP Code Not Working HELP.

I am getting an error when I run this code

<?php
      if($_GET['id'] == "")
      {
            echo = "<div class="floatleft"><h1><strong>Some Text Here</strong></h1></div>";
      }
      else
      {
            echo = "<div class="floatleft"><h1><strong>".gettitle($_GET['id'])." Some Text Here</strong></h1></div>";
      }
      
      function gettitle($querystring)
      {
            $connection = mysql_connect('servername', 'password', '') or die (mysql_error());
            $db = mysql_select_db('databasename', $connection) or die (mysql_error());
            $query = "select the_description from the_table where the_code = '".$querystring."'";
            $result = mysql_query($query) or die (mysql_error());
                  
            $row = mysql_fetch_array($result);
            extract($row);
            
            return $the_description;
      }
?>

the error i get is:

Parse error: parse error, expecting `','' or `';'' in /var/www/html/www.mysite.co.uk/site/mypage.php on line 40

Any ideas?

Hopefully a silly mistake on my part.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial