Suppose I have to write data a Microsoft Excel Workbook, I need to create a table with 5 rows and 4 columns, now in row 3 and column 4, I want to create a table with 3 column and 4 rows.
Using laravel-excel how can I achieve this? I have created the main table, but don't know how to create the inner table. Is it possible ?
Related
I have a database dump which consists of 7 seperate tables. In one table, one specific column was reset as i have forgotten WHERE statement because i am beginner.
What i need help about is
How can i restore only one specific column from one specific table in dump or,
Is there any way i can do this with PHP?
Please note that dump was exported 4 days ago and there are new rows on tables.
Create a new "temp" table and import the data from the dump file (just the records of the table you need to restore).
Next, execute an UPDATE + JOIN query on the broken table. The IDs are the same in both tables so it will be pretty easy.
Remove the "temp" table.
i created 7 tables in mysql database using phpmyadmin. From those
CAM_INFO Table is parent table for all 6 tables...and the structure is below
CAM_INFO table having "CODE" field having unique value generated by some random function in php...
And i have child table like "CANON" in that also i'm having same structure
ucture
All i want is when i delete row from CAM_INFO(parent table ) based on some condition...it will also delete in child table "CANON" having the same unique value in "CODE" field..
similarly it will also checks all 6 tables having the CODE field which is having the unique value..
I have two tables foreach row of one table need duplicate 6 rows of another table with the id of the first table. How to achieve this ? The two tables are as follows and i am using codeigniter framework. I am intentionally not pasting the MVC code as i dont want to confuse you guys. Please find the reference at https://stackoverflow.com/questions/38977815/foreach-id-create-duplicate-rows-in-another-mysql-table-codeigniter. I have attached the two tables FYR
Input is the above table and output should be the below table. I am unable to create duplicate rows foreach resignation request i.e foreach row in pr_resignation_requests table
I have a hurdle I need to try to overcome. I have a very large database I need to display in separate little excel tables on a website using html.
I know the structure of how to show an excel table on html code as well as the data inside each cell, but my tables I need to be created will vary in number of rows based on the number of columns of a row of data.
As an example one row with a unique primary key has 18 columns that need to be displayed as column 1 = cell A1, column 2 = cell B1, column 3 = cell A2, column 4 = B2, column 5 = A3.... etc. In the end it will be 9 cells tall and 2 cells wide.
The next table will have 26 columns, the next would have 6 columns... etc.
I think I need to send a query to my mysql database to ask how many columns are in the current queried row, then use that result as variable to build each table to an appropriate size?
I am totally lost at how to approach this. Maybe I need some sub script to run to build each table data string before making it html?
Help!
I have some questions about customizing export result(excel) with php. The idea is i want to export my query of my raw data (mysql table) to excel file but with some customization in the result.
for example i want to have result which is summary of the table like below table:
The 3rd column until 7th column is named based on the last 5 days of my report date.
My idea is:
1. create temporary table using format as the result table i want to generate
2. Insert the table with my raw data.
3. Delete those table.
Is that efective?or is there any better idea?
You can always use a view. Which is essentially a select statement with your data in there, and which will be updated whenever your tables are updated. Then you can just do a 'select * from view_name' and export that into your excel.
Depending on the size of the data, there is no need to think about performance.
Edit the data before
You can have a temp table. Depending on the data, this is very fast if you can select and insert the data based on indexes. Then you make a SELECT * from tmp_table; and you have all your data
Edit the data after
You can just join over the different tables, get the data and then loop (read as foreach) over the result array and change the data and export it afterwards