Using PDO instead of mysql_
<p>Im currently using this code...</p>

<pre><code>// connect to and select the database
@mysql_connect($host,$user,$password) or die("&amp;success=no&amp;");
@mysql_select_db($dbname) or die("&amp;success=no&amp;");

// query the database and return an array of data
$result = @mysql_query("SELECT * FROM $tablename WHERE rand = $rand") or die("&amp;success=no&amp;");
</code></pre>

<p>i keep getting told not to use it and to now use PDO, can someone please show me exactly how i change the above code to PDO</p>
