PHP Code Not Working HELP.

Posted on 2007-07-30
Last Modified: 2007-07-30
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/ on line 40

Any ideas?

Hopefully a silly mistake on my part.
Question by:narmi2
    1 Comment
    LVL 142

    Accepted Solution

    >            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>";

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now