Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Database question

Options
  • 16-10-2012 2:32pm
    #1
    Registered Users Posts: 173 ✭✭


    Novice Student here,

    I am doing a small business directory and setting up a user management system which will allow new records to be added.

    My headings are:
    Business Name | Phone Nr | Address | Town | County | Website

    I have a main directory table and two lookup tables for the town and the county.

    I have set up an add a business page using dreamweavers "Insert Record Form Wizard", but inserting a new record puts it at the end of the directory.

    I want to the records to go in the relevant places.. ie if the business is in Ennis, Co.Clare.. I want the entry to go Just after the last Ennis, Co.Clare entry; instead after the last Co.Wicklow entry at the end.

    Any idea how I could do this?

    Much appreciated, thanks.


Comments

  • Registered Users Posts: 26,571 ✭✭✭✭Creamy Goodness


    records will always be added sequentially, if you want to sort them do it on the output.

    not sure of dreamweaver at all but i'm guessing it's using some sort of sql have a look around the dreamweaver UI for "order by"


  • Registered Users Posts: 230 ✭✭bellylint


    Hi there,
    Not too sure about dreamweaver but I do work a lot with databases.
    What you want to do is to sort over the county and then the Town. If you specifically want to always have them appear in the order that they were entered after county and town, create a new field in the table that is an incremental number and then sort by that as the third sort property.
    This is number field with the identity property set in MS-SQL, or an autonumber in MS-Access, past that I cant speak for the other dbs out there.

    Sorry cant help directly with dreamweaver but it might give you some direction to start looking if noone else chimes in


  • Registered Users Posts: 2,781 ✭✭✭amen


    records will always be added sequentially

    sort of true. While the record is inserted sequentially if there is an Clustered Index the data may be stored based on the clustered index which may cause the data to be stored in the order as the op requested. Of course this could be expensive operation and negatively impact database performance.


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    As above, you really don't want the data to be entered in any specific order, there's no reason for that. You need to sort it into whatever arrangement you require at the point of output.


  • Registered Users Posts: 173 ✭✭Not a person


    amen wrote: »
    sort of true. While the record is inserted sequentially if there is an Clustered Index the data may be stored based on the clustered index which may cause the data to be stored in the order as the op requested. Of course this could be expensive operation and negatively impact database performance.

    Interesting, thanks. How do you implement a clustered index? Am a Complete novice to all this.

    Here is a screenshot from my database..


    8095141501_86d1fc6523_b.jpg
    We have been using dreamweaver to do a record insertion form wizard as we are not learning SQL until next semester; but if you can think of SQL i could use for this then maybe I could implement it.


  • Advertisement
  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Here's a simple tutorial using a tiny bit of php and you can customise the SQL to select whatever information you require. If you can get your head around that you'll open up a world of control dreamweaver won't provide, or at least not easily!

    http://www.w3schools.com/php/php_mysql_select.asp


  • Registered Users Posts: 173 ✭✭Not a person


    Adam wrote: »
    Here's a simple tutorial using a tiny bit of php and you can customise the SQL to select whatever information you require. If you can get your head around that you'll open up a world of control dreamweaver won't provide, or at least not easily!

    http://www.w3schools.com/php/php_mysql_select.asp

    Thanks..

    Ill give that a go tomorrow!


  • Registered Users Posts: 173 ✭✭Not a person


    I discovered that by selecting index (between unique and special) in the below table for "Business County" I am now able to put entries in the relevant county section; but not in amongst particular towns within the county.

    But still.. thats alot better than before!

    8095141501_86d1fc6523_b.jpg


  • Registered Users Posts: 173 ✭✭Not a person


    Adam wrote: »
    Here's a simple tutorial using a tiny bit of php and you can customise the SQL to select whatever information you require. If you can get your head around that you'll open up a world of control dreamweaver won't provide, or at least not easily!

    http://www.w3schools.com/php/php_mysql_select.asp

    I had a look a that, a bit much for me at the moment, but we will be doing SQL next semester! Thanks anyway though, W3schools is a great site.


Advertisement