not sure if this will work but i have had the same problem...
try this
<?php
session_start();
$rs = mysql_connect( "host", "user", "pass" );
$rs = mysql_select_db( "db" );
$sql= "SELECT * FROM Cart WHERE Session =".$_SESSION['cartid']."";
$rs = mysql_query( $sql ) or die('Query:<br />' . $sql . '<br /><br />Error:<br />' . mysql_error());
?>