Jump to content
php.lv forumi

mysql.php> xls(excel)


Recommended Posts

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted

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));

Posted (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 by edi
Posted

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 )

Posted (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 by edi
Posted

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");
?>

Posted (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 by edi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...