I have a page in my web project which displays a complete table fetched from MySQL database. I want to add a option or an extra column on the HTML table that will help to move rows up and down, wherever I want to put it. Like, moving row 1 to row 10, row 2 to row 5, etc. and dynamically making changes in the MySQL table. And also how will I be able to do it on the HTML page by providing some arrows or drag and drop or what ?
Related
This is my first mysql table.
I use HTML form in order to insert datas into a mysql table.
When submited, the form calls a php script in order to add datas into the form.
Then, mySQL table could look as follow :
From this mySQL table how could i generate and display a HTML table sorted by "NEXT_EVENT" column ?
If i want go on step ahead, is there a way a let user click on an upward / downward arrow placed next to each column header (links) in order to get the HTML table sorted as the desired column ?
--
Once the table sorted, i need to generate a raw simple TXT file where the ID on very FIRST row and NEXT_EVENT values will be copied to.
ie, sort.txt :
the 2 fields are comma separed.
2, 1499005140
Many thanks for your help,
To have such a link next to the heading you can use jQuery plugin tablesorter. You can refer at
http://tablesorter.com/docs/
And for just executing a query for one column, you can use ORDER BY clause
Hope it helps
I have 5 tables with data.
I can drag and drop rows and reassign their positions. I am grabbing the ID of the DB record they belong to.
I want to be able to update it from table one to table 2 on the database. I was told not to use AJAX because that handles updating records in the front end and it could be dangerous. I dont know what route to go for or even how to manage it.
I am using Laravel 5.3
I have some data in a MYSQL database table that I need to "print" in a HTML web page, but I need that this information be shown dynamically in a 3 row and a maximum 12 column table.
Each column must show three sets of information, that will be displayed in each row, like the table below.
Is there a way to do this using PHP and/or HTML?
Thanks for the help
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 a question to which I have been unable to find the answer.
I can create an extra column in a PHP recordset by using an existing column and duplicating it:
SELECT
id_tst,
name_tst,
age_tst,
price_tst,
price_tst AS newprice_tst
FROM test_tst
From what I can work out the AS will only duplicate an existing colulmn or rename a column rs.
I want to add two extra columns to a table, but with no values.
I know a lot of people will say whats the point in that; it's pointless to have 2 columns with no data.
The reason is I am doing a price updating module for a CMS system, where the user can download a .csv file containing prices, modify the prices in a spreadsheet then re-upload the CSV to update he prices.
the two extra columns would be to hold the new prices keeping the old so a roll back from the CSV file could be performed if nessecary.
I could just get the client to add the two new colulmns into the spreadsheet, but would prefer to have the exported CSV with the columns already in place.
Is it possible to create blank columns when creaing an rs?
You can create empty "dummy" columns by aliasing a blank string:
SELECT '' AS emptyColumn, column1, column2 FROM table
This will produce another column in your query with all blank values.