[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

PHP Code Not Working HELP.

I am getting an error when I run this code

      if($_GET['id'] == "")
            echo = "<div class="floatleft"><h1><strong>Some Text Here</strong></h1></div>";
            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);
            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.
1 Solution
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>            echo = "<div class="floatleft"><h1><strong>Some Text Here</strong></h1></div>";
is a problem:
            echo = "<div class=\"floatleft\"><h1><strong>Some Text Here</strong></h1></div>";

            echo = "<div class=\"floatleft\"><h1><strong>".gettitle($_GET['id'])." Some Text Here</strong></h1></div>";

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now