SQLSTATE: General error: 25 bind or column index out of range

ive been stuck on this on for hours i keep getting this error code SQLSTATE[HY000]: General error: 25 bind or column index out of range tried everything i could find

$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$stmt = $db->prepare('insert into rentals(title, pid, uid, address, description, amenities, manager_name, bedrooms, sale_price, property_type, manager_phone, manager_email)
values(:title, :pid, :uid,  :address, :description, :amenities, :manager_name, :bedrooms, :sale_price, :property_type, :manager_phone, :manager_email)');

        $stmt->bindParam(':title', $_POST['title']);
        echo $_POST['title'].'<br/>';
        $stmt->bindParam(':pid', $pid);
        echo $pid.'<br/>';
        $stmt->bindParam(':uid', $uid);
        echo$uid.'<br/>';


        $stmt->bindParam(':address', $_POST['street-address']);
        echo $_POST['street-address'].'<br/>';
        $stmt->bindParam(':description', $_POST['description']);
        echo $_POST['description'].'<br/>';
        $arr=   array($_POST['smoking'], $_POST['children'], $_POST['refridgerator'],
                $_POST['internet'], $_POST['utils'], $_POST['pool'], $_POST['laundry'],
                $_POST['microwave'], $_POST['stove'], $_POST['cable'], 
                $_POST['cleaning'], $_POST['ac']);
                $arr = array_filter($arr, 'strlen');
            $amenities = join(':|:', $arr);

        $stmt->bindParam(':amenities', $amenities);
        echo $amenities.'<br/>';
        $stmt->bindParam(':manager_name', $_POST['manager']);
        echo $_POST['manager'].'<br/>';
        $stmt->bindParam(':bedrooms', $_POST['bedrooms']);
        echo $_POST['bedrooms'].'<br/>';
        $stmt->bindParam(':sale_price', $_POST['prices']);
        echo $_POST['prices'].'</br>';   
        $stmt->bindParam(':property_type', $_POST['property_type']);
        echo $_POST['property_type'].'<br/>';
        $stmt->bindParam(':manager-phone', $_POST['manager-phone']);
        echo $_POST['manager-phone'].'<br/>';
        $stmt->bindParam('manager_email', $_POST['manager-email']);
        echo $_POST['manager-email'].'<br/>';

        $stmt->execute();
}catch(Exception $e){
    echo $e->getMessage();
}

unset($db);

Answers


Need Your Help

Speeding up Facebook graph API calls

python facebook facebook-graph-api asynchronous batch-processing

I have an application that uses this Python Facebook SDK to make a complex graph API call like this (basically, it takes care of the URL construction, etc.):

Unknown column in mySQL CSV import

django mysql django-models

I am trying to import a small CSV file into my django program. I am using SQL, and here is what I have so far. The CSV file itself has Column1 which is named Customer and I am trying to take that

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.