Help with Generator
Help with Generator
samsamtest
Posts: 52Questions: 15Answers: 1
Hi,
I have created and download the files when I have used the generator on the homepage.
The thing is, I don't need to create the tables. The database already exist. How can I change the generated file so it won't create a database and just get the data from it.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
In the PHP (or .NET or NodeJS) file for the table you will see something like:
Simply remove that. That said, it won't delete or replace an existing table!
Allan
Awesome, thanks.. I have another question.. If I have two primary keys how do I enter it in the Generator filed for primary key..
Can I enter it like this ? bolag_id kundnr ore like this bolag_id, kundnr
Generator doesn't support compound keys. For that you would need to edit the generated code a little.
Allan
Hi,
Thanks for the help.
I have been able to fix and creat it.
If it’s okay I have another question,
If I want to make a specific select question how do I do that..
This is the select question i have created:
select k.kundnr, k.kundnamn, sum(o.radsumma) as [radsumma]
from kund k
inner Join orderrad o on k.kundnr = o.kundnr
where o.levstatus = 'Olevererad'
group by
k.kundnr, k.kundnamn
Thanks
Kinde Regards
Sam
Hi Sam,
There is no option to do a
group by
in Editors server-side libraries at the moment I'm afraid.You can make the SQL query directly using
$db->sql('...')->fetchAll()
, but as I say, that is not supported by the Editor libraries.Allan
okay, Thanks for the help
I wonder If I don't use a the generator, Is it hard to do a select question,, ?
The thing to remember about Generator is that it is a quick start tool only. To get the most out of Editor and DataTables you need to code with their options and APIs. This example will help and also the manual documentation that it links to.
Allan