xplody xplody - 4 months ago 10
HTML Question

store values from input to excel using PHPExcel

can anyone help me store the values in my inputs to excel using PHPExcel? so far i have success storing data from my table to excel...now i wanna do is store the values in my inputs to the excel..can anyone help me please.

example of the form inputs: enter image description here
enter image description here

i want is all the data in my form will be stored in excel....my code is not working help me please.

current code:

<?php
if (!isset($_POST['send'])) { ?>
<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
<?php } else {
require_once 'Classes\PHPExcel\IOFactory.php';
$filename = 'file.xlsx';
$title = $_POST['title'];
mysql_connect("localhost","root","") or die ("cant connect!");
mysql_select_db("test") or die ("cant find database!");

$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setReadDataOnly(true);

$objPHPExcel = $objReader->load($filename);
$objWorksheet = $objPHPExcel->getActiveSheet();
$objWorksheet = $objPHPExcel->setActiveSheetIndex(0);
$name1 = $_POST['name1'];
$optA1 = $_POST['optA1'];
$optB1 = $_POST['optB1'];
$optC1 = $_POST['optC1'];
$optD1 = $_POST['optD1'];
$total1 = $_POST['total1'];
$remarks1 = $_POST['remarks1'];

$name2 = $_POST['name2'];
$optA2 = $_POST['optA2'];
$optB2 = $_POST['optB2'];
$optC2 = $_POST['optC2'];
$optD2 = $_POST['optD2'];
$total2 = $_POST['total2'];
$remarks2 = $_POST['remarks2'];

$result = array(
'$name1',
'$optA1',
'$optB1',
'$optC1',
'$optD1',
'$total1',
'$remarks1'
),('$name2',
'$optA2',
'$optB2',
'$optC2',
'$optD2',
'$total2',
'$remarks2');
if(isset($_POST['send'])){

$headings = array(
'NAME',
'Gen Info. & Technical Knowledge',
'Communication Ability',
'Attitude Towards Profession',
'Appearance',
'TOTAL',
'Remarks'
);
$points = array(
' ',
'(3 pts)',
'(3 pts)',
'(2 pts)',
'(2 pts)',
'(10 pts)',
' '
);
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setAutoSize(true);
$objPHPExcel->getActiveSheet()
->getStyle('A1:I15')
->getAlignment()
->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A1:I1')->applyFromArray(
array(
'font' => array(
'bold' => true
),
'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,
),
'borders' => array(
'top' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
),
'fill' => array(
'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR,
'rotation' => 90,
'startcolor' => array(
'argb' => 'FFA0A0A0'
),
'endcolor' => array(
'argb' => 'FFFFFFFF'
)
)
)
);
$objPHPExcel->getActiveSheet()->fromArray($headings, null, 'A1');
$objPHPExcel->getActiveSheet()->fromArray($points, null, 'A2');
$row = 3;
while( $rows = mysql_fetch_row($result)){
$objPHPExcel->getActiveSheet()->fromArray($rows, null, 'A' . $row);
$row++;
}
}

header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="'.$title.'.xlsx"');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
}
if (!isset($_POST['send'])) { ?>

<form id="form1" name="form1" method="post" action="" >
FILE TITLE: <input name="title" type="text" id="title" />
<table>
<td><input name="name1" type="text" value="" required size="41" id="query1" /></td>
<td>
<input id="textboxid" type="radio" name="optA1" value="1" />1
<input id="textboxid" type="radio" name="optA1" value="2" />2
<input id="textboxid" type="radio" name="optA1" value="3" />3
</td>
<td>
<input id="textboxid" type="radio" name="optB1" value="1" />1
<input id="textboxid" type="radio" name="optB1" value="2" />2
<input id="textboxid" type="radio" name="optB1" value="3" />3
</td>
<td>
<input id="textboxid" type="radio" name="optC1" value="1" />1
<input id="textboxid" type="radio" name="optC1" value="2" />2
</td>
<td>
<input id="textboxid" type="radio" name="optD1" value="1" />1
<input id="textboxid" type="radio" name="optD1" value="2" />2
</td>
<td><input type="text" name="total1" size="3" /></td>
<td><input name="remarks1" type="text" value="" required size="8" /></td>
</tr>
<tr>
<td><input name="name2" type="text" value="" required size="41" id="query2" /></td>
<td>
<input id="textboxid" type="radio" name="optA2" value="1" />1
<input id="textboxid" type="radio" name="optA2" value="2" />2
<input id="textboxid" type="radio" name="optA2" value="3" />3
</td>
<td>
<input id="textboxid" type="radio" name="optB2" value="1" />1
<input id="textboxid" type="radio" name="optB2" value="2" />2
<input id="textboxid" type="radio" name="optB2" value="3" />3
</td>
<td>
<input id="textboxid" type="radio" name="optC2" value="1" />1
<input id="textboxid" type="radio" name="optC2" value="2" />2
</td>
<td>
<input id="textboxid" type="radio" name="optD2" value="1" />1
<input id="textboxid" type="radio" name="optD2" value="2" />2
</td>
<td><input type="text" name="total2" id="total2" size="3" /></td>
<td><input name="remarks2" type="text" value="" required size="8" /></td>
</tr>
</table>
<input type="submit" name="send" value="send to excel" id="send" formnovalidate />
</form>
</body>
</html>
<?php }


error:

enter image description here

<br />
<b>Warning</b>: mysql_fetch_row() expects parameter 1 to be resource, array given in <b>C:\xampp\htdocs\test\index.php</b> on line <b>114</b><br />
PK ܃KD%¸õºa [Content_Types].xmlÍ”]KÃ0…ïý%·Òf› "ëváôRΓ·kXš„¼Ù׿÷m»©+Žô¦¡4ç<§'ãé®2Éjgs6Ì,+Òv™³·ÅSzÇŒÂ*aœ…œíÙtr5^ì=`Bb‹9+cô÷œ£,¡˜9–¾.T"ÒkXr/äJ,ƒ[.`ck6¿?hÉ\„ø,*Âðá‘Ü }3òcÉC+¬Ù9Þ-E¤à|cÕjêŠBKPN®+’dÍuíÂO1î
`oú Ba +“µ¦Gò
±61yÜ‘{Ûy ƒçñef¤læ`©}¡û‡Në6=‹ ý,ˆ-m¥ŽÒ·.¬Þ[]ºözÌ*¡m×¢“xœGN¨Þ nNJ=YBˆúkÙ;ÙÒ8~ܵú—ÄCÛM5È›axáÚ?ýÏÌ1ú'9nþ(–"€zËÅo ïÞǼ¹À'PK ܃KD¶78é K _rels/.rels­’ÍjÃ0€ï{
£{£´…1F^Ê ·2²Ðlå‡$–±½-}ûy‡±ºÒÃŽ–¥OŸ„vûyÕ;‡Ø‹Ó°.JPìŒØÞµ^ê§Õ¨˜ÈYű†3GØWw»g)åšØõ>ªqQC—’DŒ¦ã‰b!ž]þi$L”ò3´èÉÔ2nÊòÃoT¦:Z
áh· ê³ç[ØÒ4½áƒ˜·‰]ºÐyNì,Û•¹>¤>£j
-'
VÌ)‡#’÷EF^6ÚÜnô÷´8q"K‰ÐHàë>_ׄÖÿ¹¢eÆÍ<⇄áUdøvÁÅ
TŸPK ܃KDxÔÙ÷ Ó xl/_rels/workbook.xml.rels½“ÍjÃ0„ï}
±÷X¶Ó†R"çR
¹¶îim™Ø’¶?~ûª
m¦““˜;ó1BÛÝçгw±sV@‘åÀÐ*§;Û
x­ŸV÷À"I«eï,
1®ºÙ>c/)íDÓùÈ’‰‘à<*ƒƒŒ™óhÓMã )ÉÐr/ÕA¶ÈË<ßð0õ€êÌ“íµ€°×°zôøo×4ÂG§Þ´t!‚GûÄÏjZ$G%à—ãË%ã)íâ)ýG‡ÅÃzÑ
Œ¨_(¤ž61ÏÁÜ. óáÂ!D:ü¾QÓ1ÛÌÝ•aÊ9˜Í•aÖ¿0üì/V_PK ܃KD5‰À‰ Y docProps/app.xmlSÁnÛ0½ï+Ý9I1¬bH7ôÐb’vgN¦c¡²dˆ¬‘ôë';ˆë´Ûe:=ñ=<<’’º=4.ë0’
¾óY.2ô&”Öïñ´ûqu#2bð%¸à±G$q«¿¨M-F¶HYrðTˆš¹]II¦Æh–hŸ˜*Ä8]ã^†ª²ï‚ymг\äùW‰F_byÕŽ†âä¸êøMË`ú|ô¼;¶ÉO«omë¬NMêGkb Pqöý`Ð)9%U2Ú¢y–:WrzU[×ÉXWà•|/¨{„~f°‘´êxÕ¡á3²oij‘ýÂ>N!:ˆ<‹“ìt°k‰£þâÕˆLJŽÅNµSl¯õr$p)”c„/#î,;¤ŸÕ"ÿ%ñršxÈ &·}¾ù4ß%µø7µüÔÕ9߇DëдàÓØåˆÁÃ{투¡§vî€ñ¼—Ë¢ÚÖ±L«÷6Ô}j0º^¿®Áï±<k>ý+z>ý=_Ìòt†Çs®)ùþ)ôPK ܃KD~cJp ï docProps/core.xml}RANÃ0¼óŠÈ×*± ‚(M%@œ@B¢®Æ^ZÓĶì…ßã$mÚ Bòa×3X~ÕUô Î+£$M‰@#•^/ÈÓê6¾ ‘G®%¯Œ†iÁ“eyR›ãàÁø(iŸ» D›SêÅjî“ÀÐ|3®æZ·¦–‹-_Í›ÓKŽœv‚±ÉNRŠQÒ~¸ª‚B5hô4MRzà"¸Úÿù GŽ˜µÂÖŸÔ=8²¿¼‰MÓ$ÍiO
ó§ôåþî±·+ÝE%€”…¹pÀѸò©BœCA.» +îñ>Dý¦@^µG¼ßX±36¼…òaü=ò|z}³º%e—iÌ.ãt¾bYÎX8³¾èþŸˆTëÝOÿʦg1Ëbv¾ÊÒü|žgÙŒ¥Ù½JïVPöžwe¨$xá”Å°l4¹½ÿx}86!-´qÒ—}:‡®ÛÃàem\;@?ºÉŽ–ßPK ܃KDs‘{Y³ ¦ xl/theme/theme1.xmlíYOoÛ6¿ïSº·²lÉu‚:EìØëÖ¦
·C´DK¬)Q 餾
íqÀ€aÝ°Ë€Ýv¶h]ºO“­ÃÖý
{úc‹Šé6iSlCëƒ-’¿÷ŸïñQ¾|å^ÌÐ!’ò¤k9"‰Ïš„]ëÖhx¡c!©p`ÆÒµæDZW¶>¸Œ7UDb‚€<‘›¸kEJ¥›¶-}˜Æò"OIk.b¬`(B;øØÆÌn6m;Æ4±P‚càzs2¡>A£Œ¥µµ`>`ð•(™MøLø¹D"ÇS'û‘sÙgbÖµ@NÀFäž²ÃRÁB×jäËÞºl/‰˜ZC«Ñ
óOIWÓfN'Âñ’к—v–ü›ÿUÜ`0èœ%¿€},uV°î°ãô<5Pñ¸Ê»ßðn¯ño­à7z½ž·Q÷*¼»‚ï4Úîv³†w+¼·ªo»ßo×ð^…o¯à‡—6ÚnŸƒ"F“é
:‹ç22KÈ„³«FxàŨP¶¶»
úD­Ûk1¾ËÅ yp±¢ Ró”L°¸>ŽÇ‚âL Þ$X[)¦|¹2•ÉBÒ4U]ëãCFTO|ñô1zñôÑñý'Ç÷9~ðàøþÏ«8 uÂçßñ÷·Ÿ¢¿÷üáWf¼Ôñ¿ÿôÙo¿~i*øìëG<yôì›Ïÿü᡾-ðX‡hL$ºAŽÐ>Á6ƒ 2g£E˜Ö(pHp ¢ðÆ3®Gêλ-  ˜€ÎîÖt=ˆÄLQðZ×€»œ³Fs®e²tsfIh.f:nãC“ìþ‰Ðf)ìdjbÙHMÍ=ÑÆ!IˆBÙŸb »Ciͯ»Ô\ò‰Bw(êajtɈŽ•™è*!.sluÍ7»·Q3ûrXGBB`fbIXÍâ™Â±Qc3y«È¤äÁ\ø5‡K‘ ãh)M47ż¦î5•Èö]6ëH¡èÔ„¼Ž9ב;|Úpœu¦I¤c?’SØ¢íqeT‚×3$Cp²6Ü·)QgKë[4ŒÌ$[™ SJ^ÏÇ9›`’”õ½V©cš¼¬l3
uû}Ù^À·ác§(Öëpÿýƒgɬx_¡ßWèw±B¯Ëåó¯ËU)¶õ^;g¯m¼'”±5gäºÌ‹¸ó‚!L惜hÙç§<–âj¸Pàü ®>¡*:ˆp
bœ\B(KÖ¡D)—p»°Öòί¨lÎç¼Å½ÐXíò ˜né÷Í%›|J]P+cpZa­Ko&Ì)€§”æxfiÞK¥Ùš7!oÎ^&8íf!6
f$Èü^0X„åÜC$#2FŽÑ§uJ·u^í5MÚFëͤ&Hº8w8ï¢ÔX‰’½šŽ,©Ðhå5=ù8íZè¹à1NŸÌJfaÒµ|UšòÊd>i°y[:µ×D¤Bª,£‚*_Z¼ŽI*ý›ž›ùá|°_W‹VÇùµ°O†–L&ÄWkfªa¹ÆgŠˆƒ(8Bc6ûôv‹ÝP GEs1¡n¹ñê™_fÁÉ×>ev`–F¸¬I-ö<^ê4õì5º¿¦)­s4Å{wMÉv.4¸­ ¿zA 0Êöh×âBEªPQ( qÈe^Ò"S ±ìv¦+9¬êVÁ£(ra¤öiˆ…J§"AÈž*í|3§©Ÿ¯FeYª+ÓâwL eÙÛÎì·P´¨&¥#rÜÉ Ù¦ì‡Ãÿpçã6^§=¨¹géE\­èkGÁÆ›©pÆ£¶i¶¸éú¨Máš‚²/(ÜTø¬êoG|¢–%‚x¡S¦ßrr:w4ã2Vo·ªBÐi¼ýæSsvk³·ãlÏàkï家WSÔÖ.2ùhåÏ,>¾²wà~4cJïîÁ¥´¿øøØéÖ?PK ܃KD ™äÀ, K xl/sharedStrings.xmlm’ÍNÃ0„ï<…å‚uZ¤
•$UPJ"À$ÛÆ"þÁ»iéÛ×”ô¸Ÿg¼šÑÆó_Ý°xTÖ$|<Š8SÚJ™mÂ?‹Ç«Î¤©dc
$ü ÈçéYŒH,X
&¼&r3!°¬AKY&¼l¬×’Âè·Ya
@º“(š
-•á¬5꧅ܶ†Âò)OcTiLé[öúJcÑÍl†-ÍƎعÔî–PÖF•²a+c÷
T[è[r«uÛi(¤cÙ—jú¢ŒHQ[+ì^ú
Ù»·À®Ô9^šr°©XÙK~„>ü7~Yæ}t—ùS¾¾ï‡î*ž¡“eh>tˆàwÀSÖ·_\3Gx9À“Óxä«FhzrÀž%þŠp
éPK ܃KDwÀT;z É
xl/styles.xmlíVMoœ0½÷WX¾7à­R5¥‘zhT5[©WkÅØÈ6ÛÝüúúƒÏMVí)í!p`æyüÞŒ±’›CËÑ”fR¤˜\Ä(eÅD“âÛüý'Œ´¡¢¢\
Hñ4¾ÉÞ%Ú9<ì ²×º£¥íhP{À:Å;cºë(ÒåZª/dÂŽÔRµÔXW5‘¶sh¥SË£MŒZÊÎÑ·yk4*e/LŠceI-ÅŒlp ²¤@{ʇ¶°µQì@lakñãOÁ'Äy¥äR!Õ)ÎóØ_´(î(g…bŒ‚ðJž¼º¼h›ã|Z–8 YÒQc@‰Ü:h°·Çæ¢÷‡èFÑ#Ù\:Úæn™d¸Q±˜³¬'z–¶b Œ4^‰3TaTA£ÀúW1v«(;ÔI͌ߣZ-Õmìn/æBŸM §æ´‡ Ñ2•)Kÿ°‹[HUÙ²ÜuŠF#Kœ¢?)6;¿{ϼÍ(Žóê”ÀùƒcøYOR.óCÂAøR¹Ú‘{ã£ióÌ@§²dÜÚË@{¨ŸS®¥^æG´ëø1—áPï¾oP¹?׋K0{Ÿ=ÇìßrÖˆM–ÐÑE;©Ø“¥w{¾Šrìz”a¥ƒ
iŒl12p0ߥ¡ã¶@¿í¶LqM¹¶MHï[™³ s‹s¨ÿ·úÉÙúK€z•òÉ™ò7Ëòɪ|òå““òÉ[ùoåÿÓò£¡.šîªåN(rßÞß»ÊlšÖ¬è7L¼Ðn-gu¨×ÿ,†öW)¨TPÓž›í¥x¶¿BÅúö
QßØ^š!ÊÛs(¾^ãOXöPK ܃KDÙ|÷5¬ xl/workbook.xmlQËn1¼÷+Ý›];¶Ñ^hÓ´úBã¤gyÅÍÑ¢ÖNòõ¥ä8Ý 9ôD‘Ž8ÃÕÙ½5b‘лFNNj)Àµ^£»mäõæâí;)()§•ñù $ÏÖoV{ï¶Þß ž_RP-÷B‚¸™‹ŽÙ§–UEmVщà¸ÓùhUâ4ÞVÄ3JS¬©¦u½¨¬B÷Ä°ŒÿÃá»[8÷í`Á¥I£K¢ÉõªC7•B…ð]YÞ÷ÞHa¥OèFÎ8õ{xQˆCø0 ÉɼžËjý¬ügì¨6=Òï§Fåxƒ°§¿øœ
Õ&ÜÁFmÉN«!ù4 â¹Jð9ú!ß'Rt)]e_
Ò¢C‹y)Ψ÷û/>â£wI™«6zcÊTn”!þž+,<aû˜ÔöW6¨‘‹š wH¸Eƒé¡‘åm «¨F2ÊŽQ¸¢º|U>áx©s\"?⥞e†ÐÓz:BÏ_EŸŽÐ§#ô¢lw\IC‡t¾q•¶ù8ÊNÓÙ|ò^–ü¬‘Ùvvx0æ#×~¸¯^_3çñZë?PK ܃KD§êçm: M xl/worksheets/sheet1.xml˜]“¢8†ï÷WPܯ~t©SÓ*BÕlÍT÷ÌÎuZ¢f ¢Nï¯ß!éݾéNÞsòæÉ! döé×1±ÎT䌧s
Û¢é–Ç,ÝÏí߃ß'¶•K’Æ$á)Ûo4·?-~›]¸xÍ”JK<äÙª`&hNÅ™ÚZLó¹}2{óíI>àMUdÇÅ‘HÕûa®Æ¸p:&C×qFÃ#aiåð þ‹ßíØ–®øöt¤©,MMˆTkÊ,ËíŬ˜á›XÌøI&,¥ß„•ŸŽG"ÞiÂ/jéöUxbûƒÔÂp1Öãb¦Ìu•,Awsû3zˆ¯SŠŒ?½ä¶%ÉË3MèVÒ¸ðÖõzáüU#%©:ç~ÙQ8ªVRœh)>ñË’'¡ª‹º.z´2.¼ôìDý;Ó%M’¹iè¿ž¨«çh¶¯`AQ3µò˜îÈ)‘jžV‹Ål[Um¾Ð3MžtQœ¶¦¨´¦&Úò$/þZG–<’_åBY,sÛL|Œ<Ûz¡¹˜¼.p{Ê%?þ,³ª5Ë·„ÞŒKK·²tkKo<;¾3ž|ØÓ«<½ÚÓÕœÎä㘸²Ä7Lw0¢)þ¸§_yúµ'r&vüaÏQå9ºy:4™à—s\yŽkÏéÀxÿ¯å°ÜOÅ.]I3Á/–(ïÊŒèG z˜ªû`«ÅÏZ-v†ò×7÷yá̆gmSe<–^#µ3–0Ãmg¬`†×ÎXÃÜÎ`†ßÎØÀŒQ;#„ãvFTfàFƤΪJÖåt;ËéÃQcøÔ('Ì@Fŗ溺:RŒ«²~?%èH1®Üæ݅׌Žë5c¨»Ž^g½æ@ûуØÆvZ6ÇiÕ[÷Ä‚žØ¦'zE(ÔŒyÝÂÂMScõÈ€ZâΉËõÄÖ=± '¶é‰…=±wî®VüÎùÍ«ôaŒ‡ÉÒ¿¿­W=±uO,è‰mzb¡wEþû·Ø¨³@£jàðZSXšÂÊÖ¦˜ÂÆBSˆB‹zÜI=6©Mai
+SX›B`
SM!ß¡žtROLjSXšÂÊÖ¦˜ÂÆBSˆ&w¨§ÔS“Ú–¦°2…µ)¦°1…Тéjät¿Ò8&7P–@Ye
” ( „@‰šJ›ÿÎ+üð#À ?üð#À ?ºÇßý„\Àï~ð»€ßü.àw¿øÝ{üÝïÈüà÷ ¿ø=Àï~ð{€ß»Çßýj€0àÇ€~ø1àÇ€~øñ=þî_nä~ðû€ßü>à÷¿ø}Àï›üÃÆ×UuªÁeu¨PôçöŽ$¹ú2ã/)=¯ûù–¦D0~SÊÓ}4žœŽ©©>ñËMbiNH,ÕŽÄð-£"aéë-Ó„Jj:”jË¡<6ù·¯4nÓæ\ÜLN’,‘TÔRÆÎ\~'/ 5Ý~¤ ôSUÎKå׬8t²ö·sjp­<ÓëW±Döô"öj©VBw*âÔ¯´(OeŠ¶äYÑRô…Kõ}íŠ"Ýót¹¼v*_5Ñ)³2¢Ê÷Ìþ¡Å«#Œ¦²8›ÛÕ1¾ÀDŠ#G=ôwL~çõ±PÕ¯>Ü‹ÝTNóY1Ûí¨P–_ãx}¦éíb\¹ll%5ÓO&+¾½„íS­U…¨ôÅŒÇqy¦6o£­šåì¥|mS5}Þìèv= ÙÙi´zH«WtêAí^³ ª[Ÿ„.þPK ܃KDÂ+ÿ ™ xl/worksheets/sheet2.xmlTÉrÛ0½÷+4¼×rÚtåLšÖMgÒI&Ks¦EÈbM* ÙM¿¾ µ:é¡'Äðhyö»2Éœ×h3q2›‹lŽJÛm&îׯ?ŠÄ“´J´‰'ðâlõjy@·ó% %L°ðµÌù°vàÁíAÐúL”Dõ"M}^B%ýk°|R «$±ë¶©ç©"SeÒ7óùû´’Úv÷?X:‡Ï˜7XjIIÜ“/uíÅj3ܸÕ2ÚÂK|SUÒ=}ƒn]ôÀ­Þ–€tµL‡8¥™<¨”8(2q~²87â…~b'$7w` 'P™`Mƒ\Ä]8üÖB¾ÄÃW§ÕWÃR‘k oñpæ’eág u0qä
É%öpÆ„8àWWÎXmÈ1µûÂÖQ2n\A!Cœçº^Og§"餹‚=˜Û ÉüãªÖ7ýY’Le‘º
£Ÿ‰BÏ
áæ'ã~ð}V:#Ò¾dè膦©ìs”+!myà^\lÑ\¼|ªÁq?»ñ@±´ÏZôˆ¡}ƒ+Ìw Ž«õèƆeC¸Ö†À
P­÷H÷rcà9Ûƒ5/ùXÓÚiK×uàd;I< wAé89!Hná»t[n51PðÉ|öA$®}âhÖÑz'’
aÕ{eœ¶à½
:#õNÇˉš:©%Ëw§ÿ@\tš×-nY&º™
,M8Ÿóðšîq˜±ÎÔŠÊn½Ú´ë˜/Qº(À1åµR_ö`ÇÇèÖÚyšŒgzÔTòæ÷û#ÞÚ€uBt8¯½RíFñfLl6Ûì-ÜÛ<ív¸>u‚=L"”6„yÑ‚Ž½© ìÕÕ_PK ܃KDÂ+ÿ ™ xl/worksheets/sheet3.xmlTÉrÛ0½÷+4¼×rÚtåLšÖMgÒI&Ks¦EÈbM* ÙM¿¾ µ:é¡'Äðhyö»2Éœ×h3q2›‹lŽJÛm&îׯ?ŠÄ“´J´‰'ðâlõjy@·ó% %L°ðµÌù°vàÁíAÐúL”Dõ"M}^B%ýk°|R «$±ë¶©ç©"SeÒ7óùû´’Úv÷?X:‡Ï˜7XjIIÜ“/uíÅj3ܸÕ2ÚÂK|SUÒ=}ƒn]ôÀ­Þ–€tµL‡8¥™<¨”8(2q~²87â…~b'$7w` 'P™`Mƒ\Ä]8üÖB¾ÄÃW§ÕWÃR‘k oñpæ’eág u0qä
É%öpÆ„8àWWÎXmÈ1µûÂÖQ2n\A!Cœçº^Og§"餹‚=˜Û ÉüãªÖ7ýY’Le‘º
£Ÿ‰BÏ
áæ'ã~ð}V:#Ò¾dè膦©ìs”+!myà^\lÑ\¼|ªÁq?»ñ@±´ÏZôˆ¡}ƒ+Ìw Ž«õèƆeC¸Ö†À
P­÷H÷rcà9Ûƒ5/ùXÓÚiK×uàd;I< wAé89!Hná»t[n51PðÉ|öA$®}âhÖÑz'’
aÕ{eœ¶à½
:#õNÇˉš:©%Ëw§ÿ@\tš×-nY&º™
,M8Ÿóðšîq˜±ÎÔŠÊn½Ú´ë˜/Qº(À1åµR_ö`ÇÇèÖÚyšŒgzÔTòæ÷û#ÞÚ€uBt8¯½RíFñfLl6Ûì-ÜÛ<ív¸>u‚=L"”6„yÑ‚Ž½© ìÕÕ_PK ܃KDÍKR"x # xl/worksheets/_rels/sheet1.xml.relsMŒ1! {_A¶÷@cÌq×ù £Øp+a!,1ú{)-'“™yýä¤ÞÔ$¶p˜(bW¶ÈÞÂã~ÝŸAIGÞ0&_X—Ý|£„}4b5&,Bïõ¢µ¸@e*•x˜giûÀæuE÷BOúhÌI·ÿèåPK ܃KDÍKR"x # xl/worksheets/_rels/sheet2.xml.relsMŒ1! {_A¶÷@cÌq×ù £Øp+a!,1ú{)-'“™yýä¤ÞÔ$¶p˜(bW¶ÈÞÂã~ÝŸAIGÞ0&_X—Ý|£„}4b5&,Bïõ¢µ¸@e*•x˜giûÀæuE÷BOúhÌI·ÿèåPK ܃KDÍKR"x # xl/worksheets/_rels/sheet3.xml.relsMŒ1! {_A¶÷@cÌq×ù £Øp+a!,1ú{)-'“™yýä¤ÞÔ$¶p˜(bW¶ÈÞÂã~ÝŸAIGÞ0&_X—Ý|£„}4b5&,Bïõ¢µ¸@e*•x˜giûÀæuE÷BOúhÌI·ÿèåPK ܃KD%¸õºa [Content_Types].xmlPK ܃KD¶78é K ’ _rels/.relsPK ܃KDxÔÙ÷ Ó ¤ xl/_rels/workbook.xml.relsPK ܃KD5‰À‰ Y Ó docProps/app.xmlPK ܃KD~cJp ï Š docProps/core.xmlPK ܃KDs‘{Y³ ¦ ) xl/theme/theme1.xmlPK ܃KD ™äÀ, K

xl/sharedStrings.xmlPK ܃KDwÀT;z É
k xl/styles.xmlPK ܃KDÙ|÷5¬ xl/workbook.xmlPK ܃KD§êçm: M é xl/worksheets/sheet1.xmlPK ܃KDÂ+ÿ ™ Y xl/worksheets/sheet2.xmlPK ܃KDÂ+ÿ ™ xl/worksheets/sheet3.xmlPK ܃KDÍKR"x # à xl/worksheets/_rels/sheet1.xml.relsPK ܃KDÍKR"x # | xl/worksheets/_rels/sheet2.xml.relsPK ܃KDÍKR"x # 5 xl/worksheets/_rels/sheet3.xml.relsPK ÿ î

Answer

Perhaps if you defined your array as

$result = array(
    array(
        $name1,
        $optA1,
        $optB1,
        $optC1,
        $optD1,
        $total1,
        $remarks1
    ),
    array(
        $name2,
        $optA2,
        $optB2,
        $optC2,
        $optD2,
        $total2,
        $remarks2
    )
);

rather than as an array of string values with syntax errors

This really is basic PHP syntax, that you should be able to debug yourself

EDIT

You're also using while( $rows = mysql_fetch_row($result)){ without any database access whatsoever because you're trying to read the rows of data from the array, not from a database. Change it to:

foreach($result as $rows){

to just iterate over the array