fork download
  1. <?php
  2.  
  3. $dsn = "mysql:host=$host;dbname=$db;charset=$charset";
  4.  
  5. $opt = [
  6. PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
  7. PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_NUM ,
  8. PDO::ATTR_EMULATE_PREPARES => false,
  9. ];
  10.  
  11. $pdo = new PDO($dsn, $user, $pass, $opt);
  12.  
  13. $stmt = $pdo->prepare('SELECT id FROM dbCountries WHERE name LIKE '%:country%' OR alias LIKE '%:country%' ');
  14. $countrysId= $stmt->execute(array('country' => $first));
  15. var_dump ($countrysId);
Runtime error #stdin #stdout #stderr 0.02s 82880KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected ':' in /home/IcijLh/prog.php on line 13