I am trying to query mysql and get the result to be returned, but I am running into the following error when trying to check that the number of returned results is greater than zero. Here is my code:
    <body>
            <?php
                $servername = "localhost";
                $username = "root";
                $password = "";
                $dbname = "cd";
                 // Create connection
                $conn = new mysqli($servername, $username, $password, $dbname);
                // Check connection
                if ($conn->connect_error) {
                    die("Connection failed: " . $conn->connect_error);
                } 
                /*
                $sql = "SELECT * FROM cdlist WHERE cdlist.title =" . $_POST["cd_name"]." OR cdlist.Artist=" .$_POST["artist_name"]. " OR cdlist.Price=" . $_POST["cd_price"] . " OR cdlist.Year=" . $_POST["year"];
                */
                $sql = "SELECT * FROM cdlist WHERE cdlist.Title=" . $_POST["cd_name"];
                //$sql = "SELECT * FROM cdlist";
                $result = mysqli_query($conn, $sql);
                $json_array = array();
                if (mysqli_num_rows($result)>0){
                    while($row = mysqli_fetch_assoc($result)){
                        $json_array[] = $row;
                    }
                    echo json_encode($json_array);
                }
                $conn->close();
            ?>
    </body>
Is there an issue with either of the queries that are in the php? I can only get it to work with SELECT * FROM cdlist, but that's not the query that I'm trying to use. I know for a fact that cd_name is the correct name for the variable as well. Thanks for any help you can provide me
