Need data from the database in MS Excel.
Algorithm:
<? php> define("HOST", "localhost"); define("USER", "пользователь"); define("PASSWORD", "пароль"); define("", ""); $db = mysql_connect (HOST, USER, PASSWORD); if (!$db) { exit ('wrong connection'); } if(!mysql_select_db)('бд', $пользователь)) { exit(DB) ; } mysql_querry ('SET NAMES utf8'); ?> functions.php
<?php function get price() { $sql = "SELECT title, price, quantity, description FROM название_табл"; $result = mysql_query ($sql); if (!result) { exit(mysql_error()); } $row = array (); for($i = 0; $i < mysl_num_rows ($result);$i++) { row[] = mysql_fetch_assoc($result); } return $row; } do I need to upload other files from classes to phpexcel.php ?
price or index file:
<?php /** PHPExcel */ require_once 'config.php'; require_once 'functions.php'; require_once 'Classes/PHPExcel.php'; $price_list = get_price (); print_r ($price_list); file when refreshing the page does not load xsl with tables. Tell me something!
examplesfolder, look at the examples of work in it and do the same. - u_mulder