Export data to excel in PHP

Export data to excel in PHP

Programming with Vishal

4 года назад

37,143 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

SGR
SGR - 27.09.2023 09:38

Sir source code dawnload nahi ho Raha hai 🤒 sirf dawnload... or dawnload pending.... ase hi likh k a Raha hai

Ответить
Shashi Ranjan
Shashi Ranjan - 02.09.2023 09:34

Working fine on localhost but not downloading on server. Can You please suggest me?

Ответить
Rupesh Kumar
Rupesh Kumar - 21.08.2023 20:19

Html pdf file ko excel m export kese kre

Ответить
A Plus Marketing & Advertising
A Plus Marketing & Advertising - 04.07.2023 12:09

ms word min kesy download karin

Ответить
Ramesh Meena
Ramesh Meena - 12.06.2023 16:13

<?php
include("conect.php");
$sql="SELECT *from Record";
$result=mysqli_query($conn,$sql);

$html= '<table>
<tr>
<th>Sr no</th>
<th>SR No</th>
<th>Student, Name</th>
<th>Father,name</th>
<th>Mother,s Name</th>
<th>Class</th>
<th>Date of Birth</th>
<th>Gender</th>
<th>Mobil No</th>
</tr>';

$i=0;
while($row=mysqli_fetch_assoc($result))
{
$html.='<tr>
<td>'.++$i.'</td>
<td>'.$row['sr'].'</td>
<td>'.$row['name'].'</td>
<td>'.$row['father'].'</td>
<td>'.$row['mother'].'</td>
<td>'.$row['class'].'</td>
<td>'.$row['dob'].'</td>
<td>'.$row['gender'].'</td>
<td>'.$row['mobile'].'</td>
</tr>';
}
$html.='</table>';
header("Content-Type: application/xls");
header("Content-Diposition: attachment;filename=student.xls");
echo $html;

?>
Sir same yeh code likhne par bhi exce me export nahi ho raha h

Ответить
satish gupta
satish gupta - 26.04.2023 19:43

hi sir wordpress me excel kese download karenge admin menu custom table data ka. please help

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:09

You are greate boss

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:09

You are greate boss

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:09

I have benefited a lot from you. Many problems have been solved.

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:09

I have benefited a lot from you. Many problems have been solved.

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:09

I have benefited a lot from you. Many problems have been solved.

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:08

Thanks

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:08

Your are big Supper Man for me.

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:08

I love you Vishal bro

Ответить
Twinkle Rain
Twinkle Rain - 05.04.2023 13:07

You are greate boss

Ответить
Sohil S
Sohil S - 23.03.2023 13:05

Thanks for sharing this.

Ответить
Dasosmi
Dasosmi - 28.02.2023 19:35

the file format and extension of don't match. the file could be corrupted or unsafe

How to solve this problem
Also your download xls file same error is showing

Ответить
Ayush Gupta
Ayush Gupta - 26.02.2023 20:20

धन्यवाद

Ответить
vijayyalakshmi
vijayyalakshmi - 20.02.2023 11:37

Thank you sir
lot of thanks

Ответить
Anonyms DC
Anonyms DC - 15.02.2023 16:54

Fatal error: Uncaught Error: mysqli object is already closed in C:\xampppp\htdocs\demo\export.php:4 Stack trace: #0 C:\xampppp\htdocs\demo\export.php(4): mysqli_query(Object(mysqli), 'SELECT * FROM e...') #1 {main} thrown in C:\xampppp\htdocs\demo\export.php on line 4

I am getting this error in the export.php file pls tell me how to resolve this.

Ответить
Ayush Prajapati
Ayush Prajapati - 10.02.2023 16:12

is there any way to to insert data into excel sheet in a particular format

Ответить
Nirav Patel
Nirav Patel - 03.02.2023 08:55

Thanks vishal

Ответить
millennium infotech
millennium infotech - 14.12.2022 14:41

Kindly help me to export data in excel in server side error but local working properly

Ответить
Rajveer Singh Ranawat
Rajveer Singh Ranawat - 17.11.2022 19:39

Hello sir how to make invoice in pdf

Ответить
PP Code_Conflict
PP Code_Conflict - 28.10.2022 20:02

How to merge two cell in this

Ответить
Laugh with Comedy
Laugh with Comedy - 03.09.2022 19:02

Awesome..bro..

Ответить
Hemant Sharma
Hemant Sharma - 28.08.2022 22:26

Thanks.. Your Explanation helped me out with something I was stuck for hours..

Ответить
DMN Dulan
DMN Dulan - 24.08.2022 08:03

I did this. thanks brother!

Ответить
TCSDI_Brian Neil Castillo
TCSDI_Brian Neil Castillo - 27.07.2022 04:07

can you convert this code to pdo php?

Ответить
anusha r
anusha r - 21.06.2022 21:07

How Can we do the same with ajax request.actually i have to show only selected data which is selected by user in excel

Ответить
BOS Software and Technologies
BOS Software and Technologies - 08.06.2022 08:09

sir this method works but if our data rows exceed more than 10 so its not work any solution for exporting big data

Ответить
Ali Neisi
Ali Neisi - 05.06.2022 12:08

nice 🔥

Ответить
Rahul Mishra
Rahul Mishra - 23.05.2022 22:27

Sir I have questions if I want to download multiple report in singal file with multiple sheets. Please help

Ответить
BOS Software and Technologies
BOS Software and Technologies - 17.05.2022 09:47

Excellent Brother,
Please also make a video on export using libraries

Ответить
Esteban Piccardo
Esteban Piccardo - 05.05.2022 15:43

How can I freeze a column or row like for this case? Do you know?

Ответить
Side_Hustle
Side_Hustle - 20.02.2022 22:14

Thanks Vishal, you really solved my long-overdue work problem with this. Though I still am not quite able to generate pdf file via the code. thanks for this one.

Ответить
Shahid Hussain
Shahid Hussain - 16.02.2022 17:22

sir selected data kese excel me dwnload karain

Ответить
ABDUL SALPHAN
ABDUL SALPHAN - 16.02.2022 17:22

When I downloaded the excel, the gridlines are hidden by default. Doesn't happen like this when I open other files. What should I change?

Ответить
ABDUL SALPHAN
ABDUL SALPHAN - 16.02.2022 17:18

How can I send this file on mail without download?

Ответить
Sahil Narula
Sahil Narula - 13.01.2022 23:14

Thank you Sir very helpful

Ответить
get set talk
get set talk - 24.12.2021 06:49

Sir colour full column me kese download kare

Ответить
PRIYANK SAGAR
PRIYANK SAGAR - 07.10.2021 13:48

Thank you vishalji. Your videos are really really helpful.

Ответить
GLOBAL BUSINESS
GLOBAL BUSINESS - 29.08.2021 16:19

Great way to explain.

Ответить
AHMAD IQBAL
AHMAD IQBAL - 26.08.2021 15:32

Sir I LOVE U

Ответить
Shaktisinh Jadeja
Shaktisinh Jadeja - 16.08.2021 08:32

Kya hum JavaScript se html table ko .xlsx me download Kar Sakte hai ?
Mobile me xls file ko kaise open Kar Sakte hai ?

Ответить
Suvash Kumar
Suvash Kumar - 31.07.2021 22:19

Sir...if column has number valu start with 0 then it removes 0.. Example: if data is 017257, then I get 17257. How can I get original value?

Ответить
Virtual Board - by Vishal Bajpai
Virtual Board - by Vishal Bajpai - 18.06.2021 22:52

Sir If I have too much data in table then how to download that data and simultaneously clear half data from table ?

Ответить
Piyush Nagwani
Piyush Nagwani - 18.06.2021 10:02

very useful video you explain it in very short video whci i like it

Ответить
UMESH SHARMA
UMESH SHARMA - 17.06.2021 19:07

How can i use this code in wordpress php custom page ? please help as soon as possible...Thanks

Ответить
sikander irfan
sikander irfan - 31.05.2021 13:18

sir student table k sath agr kisi r table sy b data ly k r ak excel file ma kesy show karwayn gy

Ответить