• <?php
    $conn=mysql_connect("localhost","<user>","<pass>") or die("unable to connect localhost".mysql_error());
    $db=mysql_select_db("<database>",$conn) or die("unable to select db name");

    $file=fopen("export.csv","r");
    while(($var=fgetcsv($file,1000))!==FALSE)
    {
    $var2=$var[0];
    $var1=explode(';',$var2);

    print_r($var1);
    if($var1[0] != 'id'){
    $ro=mysql_query("SELECT <select.column> FROM <table> WHERE <column...

    Tags:
    PHP
  • <?php

    $host = 'localhost'; // MYSQL database host adress
    $db = '<database>'; // MYSQL database name
    $user = '<user>'; // Mysql Datbase user
    $pass = '<password>'; // Mysql Datbase password
     
    // Connect to the database
    $link = mysql_connect($host, $user, $pass);
    mysql_select_db($db);
     
    $table="<table Name>"; // this is the tablename that you want to export to csv from mysql.
     
    exportMysqlToCsv($table);...

    Tags:
    PHP
  • // Connect to the database
    $mcm_db = mysql_connect("localhost", "root", "");
    mysql_select_db("sample", $mcm_db);

    // Issue the query
    $mcm_query = sprintf("SELECT date, text FROM xmltb" );
    $mcm_result = mysql_query($mcm_query, $mcm_db);

    // Format the query results as XML
    if (mysql_num_rows($mcm_result) > 0) {
    // Assemble the...

    Tags:
    PHP

Pages

X