sql server - Php excel in one cell -


I am working on creating an Excel from my SQL server, the problem is that the row is in one cell Each cell has to be output. It will be easy to edit and add data.

This query and output to SQL Server is:

in excel file Output

  $ sql =>  

code" image description here. Ansatt as Tid, Basseng, routine, measure_routine, measure, rhythm, emps, form emps.user_name in the form of pools.name where routines.id = measure_routine.routine_id and measure_routine.measure_id = measurements.id and (measurements.title 'T_% ') And measure_routine.pool_id = pools.id and routines .emp_id = emps.id and pools.name = routines.date, like 'hovedbasseng' command by routines.time, "; $ Result = sqlsrv_query ($ angle, $ SQL) or die ("Could not execute the query:
" ... Sqlsrv_error () "& lt; br & gt; sqlsrv_errno ()); $ File_ending = "xls"; $ Reals = array (); // Header Info for Browser Header ("Content-Type: App / CSV"); Header ("content-dispute: attachment; file name = test.csv"); Header ("Prestama: no-cache"); Header ("End: 0"); / ******* Start formatting for Excel ******* / // Define Separator (defines columns in excel and tab in the word) $ sep = "\ t"; // tab character $ i = 0; Foreign currency (sqlsrv_field_metadata ($ result) as $ field metadata) {echo $ field matadata ["name"] + "\ t"; If ($ field matadata ["type"] == "actual") // $ field matadata ["type"] === SQL_REAL {$ reals [] = $ i; } $ I ++; } Print ("\ n"); // The end of the printing column names // while starting the loop to get the data ($ line = sqlsrv_fetch_array ($ result)) {$ schema_insert = ""; {$ J = 0; $ J & lt; Sqlsrv_num_fields ($ result); $ J ++) {if ($ line [$ j]! = "") {If (in_array ($ j, $ reals)) {$ schema_insert = Str_replace (".", ",", $ Line [$ j ]). $ September; } And {$ Schema_Intern. = $ Line [$ J] $ September; }} And $ Schema_Inter = "". $ September; } $ Schema_incent = straw_realee ($ sep. "$", "", $ Schema_interest); $ Schema_interest = pre_legal ("/ \ r \ n | \ n \ r | \ n | \ r \", "", $ schema_nirt); $ Schema_interest = "\ T"; Print (trim ($ schema_insert)); Print "\ n"; }? & Gt; "Text" after

Do this: Open table open in PHPMyAdmin you click Export to grab Choose the file type you want to export it as


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -