PHP PDO mysql multiple queries mak
One thing I can see right off the bat is that you're likely to be selecting more data than you need. A good rule of thumb is to never use SELECT * FROM. Only select the columns that you need for your query.

For example, in your gifts query you could change the query to "SELECT COUNT(*) FROM tbl_Gifts_Sent WHERE FB_ID='". $FB_ID . "'"; and only ever get one row with one field to check. You could then use $row = $statement-&gt;fetch(PDO::FETCH_NUM); and examine $row[0] to find out whether there are any rows that match that $FB_ID and use that value for $amountOfGifts. That will save you from loading too much data (all the fields in tbl_Gifts_Sent as well as saving you from looping over a potentially large resultset in PHP (much slower than letting MySQL do the work). Revised full (untested) code below:

//How Many Gifts are there----------------- 
    $sqlcommand = "SELECT COUNT(*) FROM tbl_Gifts_Sent WHERE FB_ID='". $FB_ID . "'";

    $statement = $pdo-&gt;query($sqlcommand);
    $row = $statement-&gt;fetch();

    if (!$row) {
        $amountOfGifts=0;
    } else {
        $amountOfGifts = $row[0];
    }


Also, I don't know where you're getting your query variables like $FB_ID, but it's probably a bad idea to trust them not to be SQL Injection vectors. You should probably be using PDO::prepare to build your statements; that will at least minimise the injection risk.