<?php
header("content-type:text/html;charset=utf-8"); $MyDB = new PDO("mysql:host=127.0.0.1;dbname=strike",'root','123456'); $MyDB->exec("set names utf8"); //$res = $MyDB->query("SELECT * FROM `sport`"); $msg = $MyDB->prepare("SELECT * FROM `sport`;"); $msg->execute(); $msgArr = $msg->fetchAll(PDO::FETCH_ASSOC); ?>