4 Replies - 3460 Views - Last Post: 21 January 2009 - 10:31 AM Rate Topic: -----

#1 ine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-December 08

Need help creating a simple online database

Post icon  Posted 03 December 2008 - 03:00 PM

Hello everyone, this is my first time here and I hope you can help me!

I'm trying to discover the simplest way in displaying information on a web page where visitors can sort and filter information according to their needs. Think of it as an online Excel sheet.

I have a good grasp of HTML and some knowledge of how PHP and SQL work, but other than that I'm an utter novice.

I don't care how much time it will take me to learn what I need to know, I just need to know what method is the best and I will take it from there! Most of the information I've found so far seems to take a very complicated route, including forms and whatnot, which I think is too much for my simple needs.

Even finding an online resource where I could manually enter my data and "tag" it would be a big help!

Is This A Good Question/Topic? 0
  • +

Replies To: Need help creating a simple online database

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4333
  • View blog
  • Posts: 12,128
  • Joined: 18-April 07

Re: Need help creating a simple online database

Posted 03 December 2008 - 03:22 PM

I am assuming you mean you want a table of information on the web where they can do things like clicking headers and it will sort by column or by using a simple form where someone types in some keywords, selects a filter and hits submit and gets results from the database sorted.

Generally each time a user wants to sort something by clicking a header like you might do in excel there is going to be a request sent to the web server. This is just the nature of the web. There are ways to reduce how many times you send requests and how the request is sent. This is where you get into the complex world of scripts, ajax, forms and such.

First your PHP script is going to connect to the database, pull some records out and display it in a table. So first get it setup to do something like that. Create some headers for it but get it so that you have the right query and that you are getting results.

Each time you submit a request to the server to sort based on a column, you are going to have to construct a similar query but with the "ORDER BY" clause attached to it. So second thing is to look up SQL and pay attention to the ORDER BY clause syntax. You can find tons of references on the web about this clause and tons of examples.

The next thing you need to do is setup a way to have this query sent to the database when the user wants to sort by a column. This can be done through forms like you may have seen, this can be done through AJAX which uses javascript to send a request or it can be done by simply reloading the page but giving PHP parameters to alter the query which constructs your table. The last method may be the easiest for a new person to learn and since you are familiar with PHP you may find it easy as clicking a link that reads "Sort by name" and it would take you to a page like "http://www.mypage.com/index.php?sort=name". Then the PHP script would tack on the "ORDER BY name" to the query that constructs the table of results.

So put something basic together to get some results from the database, then show your code in the PHP forum and ask how to sort by a query parameter. We can then further assist you as to how you are going to sort your results based on the parameter passed through the URL.

Hope this helps. Below is a URL that shows you a PHP script for sorting results from a database. It is a two page article so be sure to click the link for the next page to see the PHP code.

Sorting Database Results with PHP

Good luck to you. :)
Was This Post Helpful? 0
  • +
  • -

#3 ine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-December 08

Re: Need help creating a simple online database

Posted 03 December 2008 - 04:31 PM

Thanks for the time and effort you put into your answer! At least now I know where to start in finding the best way to display my data. You've been a great help!

:)
Was This Post Helpful? 0
  • +
  • -

#4 RobertsMrtn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 16-January 09

Re: Need help creating a simple online database

Posted 16 January 2009 - 08:25 AM

Hi,

Have a look at www.recs4free.com. This is about to go live in about a weeks time and will do the work for you!
Get back to me if I can be of any more help!
Was This Post Helpful? 0
  • +
  • -

#5 kiwi2  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 178
  • Joined: 16-September 08

Re: Need help creating a simple online database

Posted 21 January 2009 - 10:31 AM

look at sourceforge.net if u need software for your site and r battling to code it yourself.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1