php导出mysql到csv


    // connect to database
    include("conectar.php");

    $fp = fopen('exporterrors.csv', 'w');

    $queryString = "SELECT * FROM url_monitor where monitor='off' order by object_id";
    $rows = mysql_query($queryString);

    while ($row = mysql_fetch_assoc($rows)) {
        fputcsv($fp, $row);
    }

    fclose($fp);

发表评论

电子邮件地址不会被公开。 必填项已用*标注