PHP购物车错误:警告:mysql_num_rows()期望参数1是资源,布尔给定[重复]

I'm creating a shopping cart systems and I'm getting this error when trying to add the item to the cart.

<?php 
session_start();

require('inc/connect.php');

if(isset($_GET['action']) && $_GET['action']=="add") {

    $id=intval($_GET['id']);
    if(isset($_SESSION['cart'][$id])) {
        $_SESSION['cart'][$id]['quantity']++;
    }
    else {

        $sql_s ="SELECT * FROM product WHERE product_id = ['id']";
        $query_s=mysql_query($sql_s);
        if(mysql_num_rows($query_s) !=0) {
            $row_s=mysql_fetch_array($query_s);

            $_SESSION['cart'][$row_s['product_id']]==array(
                "quantity" => 1,
                "price" => $row_s['price']);
        }
        else {
            $message="This product id is invalid!";
        }
    }
}

?>

My error is saying line 16 which is:

$query_s=mysql_query($sql_s);
</div>

Change ['id'] to $id:

$sql_s ="SELECT * FROM product WHERE product_id = $id";