# Any SQL experts out there?



## Ray (Jul 17, 2020)

Late last weekend, my website bit the dust. Recovery wasn’t possible, so I did a fresh Wordpress installation and have imported all of the files. There are a few broken links, mostly images, but it’s otherwise operational. However, there is one major failing - none of the calculators work - TDS, fertilizer dosing, proportioning, light intensity, etc. None, nothing, nada.

I do have the sql table that contains the working data, but I have insufficient knowledge to import it into the new table.
Can anyone help?


----------



## emydura (Jul 17, 2020)

I do have some SQL knowledge. Are you just trying to extract the data from the table?


----------



## Ray (Jul 17, 2020)

No.

The particular plugin stores the pertinent data in a database table, along with a handful of samples. I have the old table with those plus the data I added. I'm trying to find out how to add those "rows" to the new table.

Whenever I've tried a simple import, nothing is added.


----------



## emydura (Jul 18, 2020)

So you are simply trying to copy the data from the old table to the new table?

Are the two tables on the same database?
Do you have the ability to write and submit SQL code?


----------



## Ray (Jul 18, 2020)

The tables are in different databases - they are identical in structure, as they are two versions of the same table and databases.

I have access to phpMyAdmin, which allows you to manipulate the data.

I exported the new table to a csv file, did the same to that table in the old DB, copied the old data into the new file and tried to import it, but the new data is not reflected in the sql table afterward.

I’m sure there’ll a sql statement that will add the rows, but I have no idea what it is.


----------



## Greg Barnes (Jul 18, 2020)

Ray have a look at posting a job request on www.fiverr.com/ For $10 you could find someone to help you


----------



## Ray (Jul 18, 2020)

I managed to figure it out, but still have issues. I might just end up rebuilding the calculators manually.


----------



## emydura (Jul 19, 2020)

Good to see you have some solution albeit not ideal.



Ray said:


> I’m sure there’ll a sql statement that will add the rows, but I have no idea what it is.



If the import of the CSV file created another table then you could simply insert the data as follows

Insert into new_table
(var1, var2, var3, var4, etc.)
select var1, var2, var3, var4 from csv_table 

That is how I do it anyway.


----------



## Ray (Jul 19, 2020)

I figured out how to add rows to the existing table, but there were still issues.

I rebuilt one that turned out to be better than the original.

Thanks for the hand-holding!


----------

