The Student Room Group

Help with code.

As a computer science student I have a large involvement with coding and programming and for my A - level project, I've decided that I want to make a website for my project with an advanced algorithm. Although I am yet to look into my advanced algorithm (Which I will most likely be coming back here for). I've ran into an issue that I cant exactly solve. On my Website. KinseyTester.epizy.com - I am trying to make a search program to search several tables for key words. If anyone has any ideas I would appreciate.
Have you got an example of what the data and the table structure/s look like? Without knowing anything about the data you're querying it's pretty hard to suggest a solution, but if you manage to get your database schema right, then it should be a fairly simple SQL statement with a WHERE clause.

When you design your database schema you need to keep your queries in mind, and use those to inform the tables you create, their fields, relationships, etc. One of the goals should be to have a database schema which is easily queryable, so if it seems difficult, there might be ways to improve the structure of your database.
(edited 4 years ago)
Reply 2
Original post by winterscoming
Have you got an example of what the data and the table structure/s look like? Without knowing anything about the data you're querying it's pretty hard to suggest a solution, but if you manage to get your database schema right, then it should be a fairly simple SQL statement with a WHERE clause.

When you design your database schema you need to keep your queries in mind, and use those to inform the tables you create, their fields, relationships, etc. One of the goals should be to have a database schema which is easily queryable, so if it seems difficult, there might be ways to improve the structure of your database.



Sorry I was on the wrong account as well as redirecting you to the incorrect website. http://kinsey.epizy.com/ is the correct website in which you should have been lead to.
I will put a PastedBin of all the code in the website page for Exercise below. Hopefully this helps. If there is any questions please quote this account and reply. Much regards,

http://pasted.co/f98f798a

Dan


I want it to show all the databases on the search table (preferably in alphabetical order) and then have the ability to refine as you search.
(edited 4 years ago)
Original post by DanK37
I want it to show all the databases on the search table (preferably in alphabetical order) and then have the ability to refine as you search.

But what does your database (SQL) actually look like? i.e. your entity-relationship model that shows how the data is stored in the database (tables, fields, relationships, etc.). The webpage/HTML isn't going to affect your database query.
(edited 4 years ago)
Reply 4
Original post by winterscoming
But what does your database (SQL) actually look like? i.e. your entity-relationship model that shows how the data is stored in the database (tables, fields, relationships, etc.). The webpage/HTML isn't going to affect your database query.


Im not sure what you mean
Original post by DanK37
Im not sure what you mean


I mean the data that you're actually trying to search - at the moment it looks like your app doesn't really use any data and everything looks like it's hard-wired directly into your HTML, but there are better ways by generating HTML using PHP instead, but you'll need that to be able to write the search algorithm and display the search results anyway.

Have you created a database using SQL yet? If not, that's the next thing to do. From your original post I was under the impression that you'd already done this, but if you haven't then It's a good idea to start out with just one SQL database table just to get something working.

Normally web apps using PHP would use that to generate the HTML - you've obviously got a lot of copy+pasted HTML elements on that page. here's a fairly minimal example of using some data from a database to create tables on a webpage:
https://www.w3schools.com/php/showphpfile.asp?filename=demo_db_select_oo_table

(Obviously you could do the same thing to generate bootstrap/flexbox grid content with <div> or whatever else instead)
(edited 4 years ago)

Quick Reply

Latest

Trending

Trending