problem Parse error: syntax error, unexpected T_STRING

Discussion in 'PHP' started by saturn100, Sep 11, 2012.

  1. #1
    I am trying to follow a tutorial and am having problem conecting to my data base
    getting this error
    Parse error: syntax error, unexpected T_STRING in /...../root/includes/funtions.php on line 4

    the code is
    <?php
    include('includes/connect.php');
    
    fucntion getPosts() {
    $query = mysql_query("SELECT * FROM posts") or die(mysql_error());
    while($post = msql_fetch_assoc($query)) {
    echo "<h2>" . $post['Title'] . " by" . $post['Author'] . "</h2>";
    echo $post['Content'];
    }
    }
    ?>
    PHP:
    any ideas
     
    saturn100, Sep 11, 2012 IP
  2. Amator

    Amator Well-Known Member

    Messages:
    1,424
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #2
    fucntion should be function....
     
    Amator, Sep 11, 2012 IP
  3. Presnus

    Presnus Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Easy one :)
     
    Presnus, Sep 15, 2012 IP