how to select a table in mysql_query php
<p>hi to all m new to OOP PHP. i have following piece of code here in the following:</p>

<p><strong>test.php</strong></p>

<pre><code>&lt;?php
class test 
{
    private $dbhost;
    private $dbname;
    private $user;
    private $pass;
    public function __construct()
    {
        $this-&gt;dbhost = 'localhost';
        $this-&gt;dbname = 'XXXX';
        $this-&gt;user = 'root';
        $this-&gt;pass = '';
    }
    public function open($obj)
    {
        $con = mysql_connect($this-&gt;dbhost,$this-&gt;user,$this-&gt;pass) or die(mysql_error());
        $db = mysql_select_db($this-&gt;dbname)or die(mysql_error());
        $query = mysql_query("SELECT * FROM '".$obj."'") or die(mysql_error());

    }

}

?&gt;
</code></pre>

<p>in the other file named test2.php i have the following piece of code:</p>

<pre><code>&lt;?php
    require_once('testClass.php');
    $obj = new test();
    $obj2 = 'user';
    $obj-&gt;open($obj2);
?&gt;
</code></pre>

<p>and i got the following error:
<strong>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''user'' at line 1</strong></p>

<p>thnx in advance for help</p>
