Results 1 to 3 of 3

Thread: Seeking advice for a web project

  1. #1

    Seeking advice for a web project

    Hey all you out there
    In the near future I'll have to make a small survey/rating system for a Danish forum I'm a member off. Basically it's a contest where users have to rate a series of pictures each week for a month or so. I'm targeting an Apache Server with mysql and PHP just in case.
    The idea is, that the users register them self in a database and then they'll have to rate the images. Each week I'll add some new images to rate, so the user must be able to login and ontinue rating.
    My thought is to create a couple of databases. One for the users and one for the series off images with a record for each user who has rated the images. I want the user presentation to look kind off nice and let the user be able to go forward and back quickly without wating for a page to load. Therefore I'm thinking about writing an Applet. (The user shouldn't download anything to vote)
    I'm also thinking about making some few PHP scripts to tie it all together because I'm not familiar with accessing databases through Java.

    Now I'm requesting thoughts on this solution and possible better ways to do it. I'm not familiar with any way to make this kind of project with pascal, so if there are ways to o it I'm listening.
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Seeking advice for a web project

    It sounds to me like this is going to be your first web application. Which is alright as you have to start somewhere...

    I wouldn't recommend Java as it requires the installation of an extra runtime, which for some is not convenient and some just don't like it. You can just as easily get the same quick loading effect using the AJAX technology and a little know how.

    Do a quick google for the 'XMLHttpRequest' object. There are some really good tutorials on it's usage and functionality, I think you'll find it completely changes the way a webpage becomes dynamic!

    As for your database (singular) The structure of a database works as follows:

    Database->Table->Record->Field

    You only need 1 database which you will have 1 table for users and 1 table for your images.

    To give you an example of how this is like Pascal...

    Think of a Table as a Record and each variable within the record with it's own type. (INT, VARCHAR, DATETIME, FLOAT, etc...) A database is really just a series of tables that you can access to retrive the records you want with a query string. (in the form of a SQL command)

    Here is the mysql page in the PHP manual: http://ca3.php.net/mysql

    You are looking to go through this process:

    1) Connect to your DB server (know your server address, username and password)
    2) Select your DB
    3) Run your query string! (some knowledge of SQL helps; http://dev.mysql.com/doc/refman/5.0/en/sql-syntax.html)
    4) Fetch the next record from your results into a record object. ()
    5) Access the fields using the returned associated array. (Not the only way, but this is a heck of a lot easier!)
    6) Repeat 3 if you need more data...
    7) Close DB Connection!

    It's not really all that hard to work with.


    The rest depends on how you want the page to flow/function.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3

    Seeking advice for a web project

    Thanks for your reply

    As for your database (singular) The structure of a database works as follows:

    Database->Table->Record->Field

    You only need 1 database which you will have 1 table for users and 1 table for your images.

    To give you an example of how this is like Pascal...

    Think of a Table as a Record and each variable within the record with it's own type. (INT, VARCHAR, DATETIME, FLOAT, etc...) A database is really just a series of tables that you can access to retrive the records you want with a query string. (in the form of a SQL command)

    Here is the mysql page in the PHP manual: http://ca3.php.net/mysql

    You are looking to go through this process:

    1) Connect to your DB server (know your server address, username and password)
    2) Select your DB
    3) Run your query string! (some knowledge of SQL helps; http://dev.mysql.com/doc/refman/5.0/en/sql-syntax.html)
    4) Fetch the next record from your results into a record object. ()
    5) Access the fields using the returned associated array. (Not the only way, but this is a heck of a lot easier!)
    6) Repeat 3 if you need more data...
    7) Close DB Connection!
    Actually I allready knew that (I've taken a database course at uni). I just wasn't focused on the database aspect and failed to use right terminology. My bad ops:
    I wouldn't recommend Java as it requires the installation of an extra runtime, which for some is not convenient and some just don't like it. You can just as easily get the same quick loading effect using the AJAX technology and a little know how.
    I don't think it would actually be a problem if the users had to use a runtime enviroment like Java. Actually I believe that most user for this app would allready have it installed.

    Do a quick google for the 'XMLHttpRequest' object. There are some really good tutorials on it's usage and functionality, I think you'll find it completely changes the way a webpage becomes dynamic!
    This seems interesting and I'll look deeper into it. If I can avoid using Java and still get a result that I'm satisfied with using AJAX technology I'll go that way.
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •