# Php parse error

**URL:** <https://forum.kirupa.com/t/php-parse-error/200954>\
**Category:** Uncategorized\
**Created:** [September 17, 2006, 2:19am UTC](https://forum.kirupa.com/t/php-parse-error/200954 "2006-09-17T02:19:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitaeshi](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kitaeshi](https://forum.kirupa.com/u/kitaeshi)\
**Post date:** [September 17, 2006, 2:19am UTC](https://forum.kirupa.com/t/php-parse-error/200954/1 "2006-09-17T02:19:19Z")

</div>

Hi all, i tried to follow a tutorial on the website,  
[http://www.intranetjournal.com/articles/200408/ij\_08\_05\_04a.html](http://www.intranetjournal.com/articles/200408/ij_08_05_04a.html)  
to build a CMS website  
i having a parse error on the code, but i dont see anything wrong with the coding. Hope someone here can point out my errors.

**Warning** : mysql\_query(): supplied argument is not a valid MySQL-Link resource in **d:\easyphp1-8\www\cms est1.php** on line **36**

**Warning** : mysql\_fetch\_array(): supplied argument is not a valid MySQL result resource in **d:\easyphp1-8\www\cms est1.php** on line **40**

Thanks for reading.

\<?php

class first\_class{  
var $settings;

```
function connection(){
    $settings['host'] = "localhost";
    $settings['username'] = "kitaeshi";
    $settings['password'] = "cheeze";
    $settings['database'] = "dababase1";
    
    return $settings;
}

```

}

class second\_class extends first\_class{

```
var $link;
var $theQuery;

function setConnection(){
    $setting = first_class::connection();

    $host = $settings['host'];
    $user = $settings['username'];
    $pass = $settings['password'];
    $db = $settings['database'];
    
    $this-&gt;link = mysql_connect($host, $user, $pass);
    mysql_select_db($db);
    register_shutdown_function(array(&$this, 'close'));
}

function query($query){
    $this-&gt;theQuery = $query;
    return mysql_query($query, $this-&gt;link);
}

function fetchArray($result){
    return mysql_fetch_array($result);
}

function close(){
    mysql_close($this-&gt;link);
}

```

}

$connector = new second\_class();  
$result = $connector-\>query(“SELECT email FROM table1”);  
$row = $connector-\>fetchArray($result);  
print $row[“email”];  
?\>
