Amigo, buenas, una pregunta, hay alguna manera de que antes de presionar el boton "Import" se vean reflejados los datos del excel en la tabla? digo, como para que se vea lo que vas a importar como segunda capa de seguridad para no subir una mala informacion, ya que ahí muestra la infomacion en la tabla, pero despues de haberla importado¿? gracias.
Hola @user-qz7hd6rq2q, Sí, es posible mostrar los datos del archivo Excel en la tabla antes de presionar el botón "Importar". Puedes cargar el archivo Excel en el frontend y mostrar los datos en una tabla como una vista previa para verificar antes de importarlos. Esto proporciona una capa adicional de seguridad para asegurar que no se suba información incorrecta. ¡Gracias por tu pregunta! 😊
You're welcome! I'm really glad to hear that the idea helped you out. If you have any more questions or need further assistance, feel free to ask. Best of luck with your data importing project using PHP and MySQL! 🚀
Hi @user-nv5xs8lg3w, Hi, if the data transfer from the Excel file to the database isn't working but the file is stored in the upload folder, double-check your code that reads and processes the Excel file. Make sure the data is being parsed correctly and the database insert statements are executed properly. Let me know if you need more specific help! 😊
Hi @oko.b.3085! It sounds like the issue might be with how the script handles different file formats. Ensure your script supports both .xls and .xlsx formats. You might need to use different libraries or settings to handle .xls files correctly.
Hi data transfer from excel file to database not working, but it stores excel file in the upload folder. Do we need to install the composer in the folder or any other installation needed for successful transfer of data. At present there is no error. While inspecting it shows internal server error. Need help....
Hi @kirana.g581! If your data transfer is not working but the file uploads correctly, there might be an issue with the script processing the Excel file. Ensure all necessary libraries are installed, such as PHPExcel or PhpSpreadsheet, and verify your server configuration. An internal server error often indicates a server-side issue, so checking your server logs can provide more details. If Composer is needed for your libraries, make sure all dependencies are installed correctly. Let me know if you need further assistance!
Hi @anonymous-ei2pk! This video can still be useful for newbies, but it may require some additional troubleshooting and understanding of server configurations and library installations. If you're new to web development, don't get discouraged. These issues are part of the learning process, and asking for help, like @kirana.g581 did, is a great way to learn and improve! If you have specific questions, feel free to ask!
hello .. Thanks for helping video.. I have a problem when upload Excel file to database..the arabic letters turns to unclear symbols.. how to solve this problem please???
Hello, thanks for watching. It sounds like you are experiencing an issue with character encoding when uploading an Excel file with Arabic text to a database. Check the character encoding settings in your database: Make sure that your database is set up to handle Arabic characters correctly. UTF-8 is the most commonly used character encoding for international text, and should be supported by most databases. Check your database documentation to ensure that it is configured correctly.
Hi @jastinmagayon3128, If the content of your Excel file isn't showing correctly, it might be due to how the data is being read or displayed. Ensure you're using the correct library and methods to parse the Excel file. Let me know if you need more help! 😊
I'm sorry to hear that you're experiencing difficulties with uploading Excel files to SQL. Can you please provide me with some additional information about the issue? For example, what type of error message are you receiving? Also, have you checked to ensure that your Excel file is formatted correctly for SQL? Once I have more information, I will do my best to help you find a solution to this problem.
Salam bro, i did everything as you teach on the video, unfortunately the file/data that submitted inti database is not success. There is no data uploaded after i press submit button. Please help me :(
Wa alaikum assalam! It sounds like there might be an issue with the data submission process. Double-check your PHP script to ensure that it correctly processes the form data from the uploaded Excel file and inserts it into the MySQL database. Look for any potential errors or missing steps in your PHP code that could be causing the data not to upload successfully. If you need further assistance, feel free to share more details or specific parts of your code, and I'll do my best to help you troubleshoot and resolve the issue.
New subscriber here! Your tutorials are great and it really helps me a lot in my current project. Regarding this tutorial, I just want to ask if there's a function that will restrict the data from inserting into the database if there's already a data that has the same value in the new excel file you want to import. Thank you!
Hi @MarekCzerepowicki! To read data from all sheets in a multi-sheet XLSX file, you can use a library like PHPExcel or PhpSpreadsheet. These libraries provide methods to loop through each sheet and extract data accordingly. If you need more specific instructions or an example, let me know!
Hello, Thanks for sharing but, When uploading no successfuly msg appair the page just reload and nothing happens, also the file save in uploaded files but its not uploaded to db can you fix it please ?
Hi @MohamedAhmedH93, I appreciate your feedback and I'm sorry to hear about the issues you're facing. Let's work together to troubleshoot and resolve these problems: - Success Message Display: Check if your success message is properly implemented in your PHP code. Ensure it's set to display when the upload and database insertion are successful. - File Upload to Database: Double-check the portion of your PHP code responsible for saving data to the database. Verify that all necessary fields are being properly populated. - Error Handling: Implement error handling in your PHP code to capture any potential issues during the upload process. Check for error messages that might provide insights into what's going wrong. - Database Connection: Confirm that your database connection is correctly configured. Ensure that there are no connection errors preventing the data from being stored in the database. - File Permissions: Ensure that the directory where your uploaded files are saved has the correct permissions to allow file writing. If the issue persists after checking these steps, consider sharing the relevant sections of your PHP code (excluding sensitive information) so I can take a closer look and provide more specific guidance. Feel free to provide more details, and we'll work together to fix this!
Thank you for reaching out and sharing your experience! It sounds like you've successfully uploaded the Excel file to the 'Uploads' folder, but you're facing an issue with the SQL query not injecting the data into the database. This kind of situation can have a few potential reasons, and I'm here to help you troubleshoot it. Here are a couple of steps you can take to identify and address the issue: - Check Error Messages: First, make sure to check for any error messages that PHP or MySQL might be generating. These messages can provide valuable insights into what's going wrong. You can enable error reporting in your PHP script or check the MySQL error logs. - Database Connection: Verify that your database connection is established correctly. Double-check the connection credentials, hostname, username, and password in your PHP code. - SQL Syntax: Review the SQL query you're using to inject the data into the database. Make sure the query is correctly structured and that the table name and column names match your database schema. - Data Format: Ensure that the data being extracted from the Excel file is in the expected format and matches the data types of the corresponding columns in your database table. - Escaping and Security: Be sure to properly escape and sanitize the data before injecting it into the SQL query. This helps prevent SQL injection vulnerabilities and ensures data integrity. - Permissions: Check the permissions of the 'Uploads' folder and make sure it's writable by the web server. Also, ensure that the MySQL user has the necessary permissions to insert data into the specified table. If you've reviewed these aspects and are still encountering issues, don't worry. Debugging can sometimes be a process of trial and error. Feel free to share more details about your code or any error messages you're encountering, and I'll do my best to assist you further. Remember, each setup can have its own nuances, so we'll work through this together. Good luck!
Hi David, hi, I have a small problem, the code works correctly, only 15 empty rows are always uploaded to the database after any import. It's a weird problem. Thanks for the reply.
Hi @sopianamarlina9785! Jika versi PHP 8.1.10 menyebabkan banyak error pada file Excel reader, pastikan Anda menggunakan versi terbaru dari library seperti PhpSpreadsheet yang kompatibel dengan PHP 8.1.10. Versi library yang lebih lama mungkin tidak sepenuhnya kompatibel dengan versi PHP yang lebih baru. Jika ada pertanyaan lebih lanjut, jangan ragu untuk bertanya!
@Cz-rg2sb Salam! It seems like there might be an issue with the data submission process. Make sure that your form is correctly configured to send data to the PHP script that processes the form. Check your PHP script for any errors that might prevent data from being inserted into the database. If you're still facing issues, feel free to ask for more specific help, and I'll do my best to assist you!
Bro it show me warning (warning move_uploaded_file(Upload/2023......) Fails to open stream: No such file or directory in C:\xampp\htdocs\upload\index.php on line 56 ) Please help me bro 🙏
I'm sorry to hear that you're experiencing an error message. It sounds like there might be an issue with the file path. Have you tried double-checking the directory and file name to make sure they match the upload code?
Hi @sithanyak4151! Unfortunately, I can't provide CodeIgniter code directly here, but you can adapt the PHP code to work within the CodeIgniter framework by following their documentation. If you need specific help, feel free to ask!
The compatibility of the code shown in the video with version 8.2.0 of your tools (such as VS Code) may vary, as the video might have been created using different versions.
Hey there! I'm sorry to hear that you're encountering an error with the '$reader' line. Let's see if we can figure it out together and get your code working! To better assist you, could you please provide me with some additional information? Specifically, I'd need to know which part of the code you are referring to, and any error messages or codes that are displayed when you encounter the issue. This will help me pinpoint the problem more accurately. In the meantime, here are a few general tips that might help you troubleshoot the error: - Make sure that the variable '$reader' is properly defined before its usage. - Double-check if the correct libraries or modules are imported or included in your PHP script. - Verify if the file you are trying to read exists in the specified location. Once you share more details about the error, I'll be able to provide a more specific solution. Don't worry; we'll get this sorted out together! Feel free to ask any questions, and I'll do my best to assist you.
- Check the file size: Some systems may have a limit on the file size that can be uploaded. Make sure your Excel file is within the acceptable file size limit. - Check the file type: Make sure that the file you are trying to upload is in the correct format. Sometimes the file extension might be incorrect, so try changing the file extension to .xlsx and see if it works. - Check the file name: Try renaming the file to something shorter and simpler, without any special characters or spaces. - Check for errors in your code: Make sure there are no errors in your code that could be preventing the file from being uploaded. - Try uploading a different Excel file: If you're still having trouble, try uploading a different Excel file to see if the issue is with the file itself or with your system.
Hi @rilannn23! Untuk mengarahkan ke nomor kolom Excel tertentu, kamu bisa menggunakan indeks kolom dalam array $row. Misalnya, jika kamu ingin mengakses kolom B, kamu akan menggunakan $row[1], kolom C menggunakan $row[2], dan seterusnya. Jika ada pertanyaan lebih lanjut, jangan ragu untuk bertanya!
Hi @user-nv5xs8lg3w, Yes, it is. 😊 Once the data is imported into your MySQL database, it will remain there permanently unless you choose to delete or modify it. Let me know if you have any more questions!
Hi @user-wf8nq7wr5j, I'd be happy to help you troubleshoot the issue, but I'll need more information to provide a specific solution. Could you please provide details on: Any error messages you're encountering. The specific step where you're facing the problem. Any code snippets related to the part that isn't working. With this additional information, I'll be better able to assist you in getting your import from Excel to MySQL with PHP up and running. Looking forward to helping you resolve this!
Fatal error: Uncaught ValueError: XMLReader::open(): Argument #1 ($uri) cannot be empty in C:\xamp\htdocs\php\excell\excelReader\SpreadsheetReader_XLSX.php:960 Stack trace: #0 C:\xamp\htdocs\php\excell\excelReader\SpreadsheetReader_XLSX.php(960): XMLReader->open('') #1 C:\xamp\htdocs\php\excell\excelReader\SpreadsheetReader.php(238): SpreadsheetReader_XLSX->rewind() #2 C:\xamp\htdocs\php\excell\excell.php(42): SpreadsheetReader->rewind() #3 {main} thrown in C:\xamp\htdocs\php\excell\excelReader\SpreadsheetReader_XLSX.php on line 960 i got this error how can i fix it sir?
Hi @ideamark8787, I appreciate you reaching out, and I'm sorry to hear about the error you're facing. The error you've mentioned indicates an issue with XMLReader and an empty URI. Here are a few steps you can take to troubleshoot this: - Check File Path: Make sure that the file path you're providing to the XMLReader is correct. The error might occur if the file is not found. - File Existence: Confirm that the Excel file exists at the specified path. If the file is not found, XMLReader might receive an empty URI. - File Permissions: Ensure that the PHP script has the necessary permissions to read the Excel file. File permissions issues can sometimes lead to this error. - File Content: Validate that the Excel file is in the correct format and not corrupted. An invalid or corrupted file might cause XMLReader to encounter issues. If the problem persists, you might want to share the relevant sections of your PHP code where you're using XMLReader and opening the file. This will help me provide more specific assistance. Feel free to provide more details, and we'll work together to resolve this issue!
I'm sorry to hear that you're encountering an error. In order to help you, can you please provide me with more details about the error message you're receiving? This will allow me to better understand the issue and provide more specific guidance on how to resolve it.
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ...LOCAL\excelReader\SpreadsheetReader_XLSX.php on line 456 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ...LOCAL\excelReader\SpreadsheetReader_XLSX.php on line 581 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ...LOCAL\excelReader\SpreadsheetReader_XLSX.php on line 1049 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ...LOCAL\excelReader\SpreadsheetReader_XLSX.php on line 1083 Fatal error: Uncaught Error: Class "ZipArchive" not found in ...LOCAL\excelReader\SpreadsheetReader_XLSX.php:217 Stack trace: #0 ...LOCAL\excelReader\SpreadsheetReader.php(166): SpreadsheetReader_XLSX->__construct('../private/uplo...') #1 ...LOCAL\Motorpool\vh_list.php(29): SpreadsheetReader->__construct('../private/uplo...') #2 {main} thrown in ...LOCAL\excelReader\SpreadsheetReader_XLSX.php on line 217
Thank you for bringing up the warnings and fatal error you encountered. The warnings you mentioned about the 'continue' statements in the 'SpreadsheetReader_XLSX.php' file are related to changes in PHP versions. The warning suggests using 'continue 2' instead of 'continue' to explicitly continue the outer loop. This adjustment helps to avoid unexpected behavior. Regarding the fatal error stating that the 'ZipArchive' class is not found, it indicates that the required PHP extension for ZIP file manipulation is missing or not enabled on your server. The 'ZipArchive' class is necessary to handle ZIP files, which are used in the process of reading XLSX files in the example. To resolve these issues, you can follow these steps: 1. Update the 'SpreadsheetReader_XLSX.php' file by replacing the 'continue' statements with 'continue 2' as suggested in the warning messages. 2. Enable the 'ZipArchive' extension in your PHP configuration. You can do this by locating the 'php.ini' file and uncommenting the line that enables the 'zip' extension (e.g., remove the semicolon at the beginning of the line). If you don't have access to the 'php.ini' file, contact your hosting provider to enable the extension for you. If you encounter any further issues or need additional assistance, please provide more details, thank you!!!
I did tried but unfortunately it doesnt work. I check my script and it definitely is correct. why do you think is that. does this still support 000webhosting or the latest php version?