edi Posted November 25, 2009 Report Share Posted November 25, 2009 kā var ar php palīdzību no mysql datubāzes ierakstīt .xls failā ? Quote Link to comment Share on other sites More sharing options...
marcis Posted November 25, 2009 Report Share Posted November 25, 2009 Kaut kā šitā $lines = array(); $sql = "SELECT col1, col2, col3 FROM `tabula`"; $res = mysql_query($sql)or die(mysql_error()); while($row = mysql_fetch_array($res, MYSQL_NUM)){ $lines[] = implode("\t", array_values($row)); } file_put_contents('fails.xls', implode("\n", $lines)); Quote Link to comment Share on other sites More sharing options...
edi Posted November 25, 2009 Author Report Share Posted November 25, 2009 (edited) Kaut kā šitā $lines = array(); $sql = "SELECT col1, col2, col3 FROM `tabula`"; $res = mysql_query($sql)or die(mysql_error()); while($row = mysql_fetch_array($res, MYSQL_NUM)){ $lines[] = implode("\t", array_values($row)); } file_put_contents('fails.xls', implode("\n", $lines)); strāda)) thq ----- kā lai izvada linku uz failu tajā pašā lapā? :D Edited November 25, 2009 by edi Quote Link to comment Share on other sites More sharing options...
briedis Posted November 25, 2009 Report Share Posted November 25, 2009 ar echo $link; ???? Quote Link to comment Share on other sites More sharing options...
edi Posted November 25, 2009 Author Report Share Posted November 25, 2009 ar echo $link; ???? nē Quote Link to comment Share on other sites More sharing options...
briedis Posted November 25, 2009 Report Share Posted November 25, 2009 nē Kā nē? echo "<a href='$links'">nosaukums</a>"; Quote Link to comment Share on other sites More sharing options...
edi Posted November 25, 2009 Author Report Share Posted November 25, 2009 Kā nē? echo "<a href='$links'">nosaukums</a>"; neredzi zem nika rakstīts "Māceklis". es vēl nemāku dabūt iekšā $link linku uz failu ) Quote Link to comment Share on other sites More sharing options...
briedis Posted November 25, 2009 Report Share Posted November 25, 2009 neredzi zem nika rakstīts "Māceklis". es vēl nemāku dabūt iekšā $link linku uz failu ) Nemāki piešķirt mainīgajam vērtību? Quote Link to comment Share on other sites More sharing options...
edi Posted November 25, 2009 Author Report Share Posted November 25, 2009 Nemāki piešķirt mainīgajam vērtību? tā, lai izvadītu tikko izveidotā faila linku? nē ) Quote Link to comment Share on other sites More sharing options...
marcis Posted November 25, 2009 Report Share Posted November 25, 2009 Saglabājot failu tak tu jau norādiji vismaz daļu linka :) Quote Link to comment Share on other sites More sharing options...
edi Posted November 26, 2009 Author Report Share Posted November 26, 2009 (edited) Saglabājot failu tak tu jau norādiji vismaz daļu linka :) vakar slikta diena bija :D var kaut kā pirms datiem no datubāzes ielikt tekstu? Edited November 30, 2009 by edi Quote Link to comment Share on other sites More sharing options...
edi Posted November 30, 2009 Author Report Share Posted November 30, 2009 vēljoprojām aktuāli :) Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 30, 2009 Report Share Posted November 30, 2009 var kaut kā pirms datiem no datubāzes ielikt tekstu? iemacies pamatus !!!! php failaa skriptaa tiiru tekstu izvada: 1. KA TIIRU TEKSTU BEZ <?php un ?> 2. ar echo paliidzibu 3. ar print() paliidzibu -- tatad varjanti mans teksts bla bla bla , tai skaita HTML kods <?php echo 'Sheit atrodas php kods'; ?> te atkal textc <?php print("TE ARII VAR IZVADIIT TEKSTu"); ?> Quote Link to comment Share on other sites More sharing options...
edi Posted November 30, 2009 Author Report Share Posted November 30, 2009 (edited) iemacies pamatus !!!! php failaa skriptaa tiiru tekstu izvada: 1. KA TIIRU TEKSTU BEZ <?php un ?> 2. ar echo paliidzibu 3. ar print() paliidzibu -- tatad varjanti mans teksts bla bla bla , tai skaita HTML kods <?php echo 'Sheit atrodas php kods'; ?> te atkal textc <?php print("TE ARII VAR IZVADIIT TEKSTu"); ?> kad atver failu ar exceli vins garumzimju vieta rada keburus ) P.S es domāju par to tekstu xls faila :) Edited November 30, 2009 by edi Quote Link to comment Share on other sites More sharing options...
briedis Posted November 30, 2009 Report Share Posted November 30, 2009 Garumzīmes nerādīs, ja nebūs faila kodējums utf-8 without BOM un norādīts meta tags ar content encoding utf-8. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.