Should I turn those into an extra column or should they become seperate tables?
They should definitely be stored in a separate table (say, food_category) and you should add an appropriately-named foreign key to the table you posted (let's called that food).
In SQL, you'd use a statement like this to create the tables with the foreign-key relationship in place, note the references line:
create table food_category (
id serial primary key,
name varchar(32) not null unique
create table food (
id serial primary key,
category_id int references food_category(id) not null,
name varchar(32) not null unique,
I'd start by learning Java. Then SQL. When you've learned Java and SQL, then learn HTML. Now you've mastered those relatively simple subjects, just learn all of the glue that connects them together. Once you've done that, it's quite simple:
Your attendence is probably represented by a join table; a student attends a lesson. so your attendance table will contain student_id and lesson_id.
Now, on your HTML form you should generate a list of checkboxes for every student who might attend the class (probably based on their subject and grade, or whatever). The checkbox's value should equal the student's ID:
When the form is submitted, only the checked checkboxes that are checked (i.e. those who have attended the lesson) will be included in the form data. Save each of the IDs you recieve as a row in the attendance table. Easy.
True, and if she wants to continue and learn then fair play, and I hope she manages to build something great.
However, she's using a discontinued tool that outputs unmaintainable HTML, and developing her site clearly isn't her goal; letting people know about her jewelry (which looks fantastic, by the way Sanda) is.
Plus, as there's a products tab on her site, one would expect that some kind of 'web shop' is on the radar. That won't be doable in Webplus, and it's not the easiest thing to implement from scratch at the best of times.
I doubt it's your query that's slow. What happens if you simply run the query select * from Doopgegevens; in a shell? For ~10k rows, providing your table is holding 'normal' data (and not base64 encoded movie files or something) it should be fast. If it is fast, try changing your data list to only use a subset of your table's columns, which will indicate if that's where your performance problem is.
[QUOTE=red_ruewei;1694533]thanks for reply.
I try something like this to read record with range month and year.
Example from June, 2011 to June 2012
Select * from table where (YEAR(date1)>='$year1' AND MONTH(date1)>='$mon1') and (YEAR(TKH_date1)<='$year2' AND MONTH(TKH_date1)<='$month2')
i had test this. And run separately.
(YEAR(date1)>='$year1' AND MONTH(date1)>='$mon1')
For above code it run smoothly
(YEAR(TKH_date1)<='$year2' AND MONTH(TKH_date1)<='$month2')
But for this code, it fail....
Fails why? What error? What variables? Also, by calling YEAR(blah) you're going to bypass your indices and your query will be slow. Something like this is better and will work.
SELECT * FROM table WHERE date_data >= '2011-06-01' AND date_data < '2011-07-01';