Focus mode

PHP Temel

Between

PDO Between

<?php
try {

    $host = 'localhost';
    $dbname = 'your';
    $username = 'root';
    $password = 'root';

    $db = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8", "$username", "$password");
} catch ( PDOException $e ){
    print $e->getMessage();
}

    $sql = "SELECT * FROM test WHERE id BETWEEN 2 AND 4";
    $query = $db->query($sql);

    if ( $query->rowCount() ){
        print_r($query->fetchAll(PDO::FETCH_ASSOC));
    }

?>
left-disk

Programs to Accelerate Your Progress in a Software Career

Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!

right-cube

Comments

You need to enroll in the course to be able to comment!