+ Reply to Thread
Results 1 to 5 of 5

Thread: ¿how to join a database with a website?

  1. #1
    g2001a65 is offline x10Hosting Member g2001a65 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    2

    Question ¿how to join a database with a website?

    Hello friends, I'm new in the programming business and in the forum, and I'd be glad if you could help me. the question is, I have a database and a website, what can i do for join them?. I want that a visitor can check only a little bit of that database.

  2. #2
    jessicams16863's Avatar
    jessicams16863 is offline x10Hosting Member jessicams16863 is an unknown quantity at this point
    Join Date
    Aug 2011
    Location
    北京,中国
    Posts
    3

    Re: ¿how to join a database with a website?

    Are you already using a scripting language on your site? What kind of database do you have? If you use something like PHP and MySQL, I would recommend using PDO (PHP Data Objects) to access and query that database.

    The manual entry: http://php.net/manual/en/book.pdo.php

    Here's a reasonable guide to getting it working:
    http://www.kitebird.com/articles/php-pdo.html

    If you want more specific help, you might want to be more specific about what you have so far.

  3. #3
    g2001a65 is offline x10Hosting Member g2001a65 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    2

    Wink Re: ¿how to join a database with a website?

    Quote Originally Posted by g2001a65 View Post
    Hello friends, I'm new in the programming business and in the forum, and I'd be glad if you could help me. the question is, I have a database and a website, what can i do for join them?. I want that a visitor can check only a little bit of that database.
    I am designing a website, and I want that a visitor can choose only one option from a database that I've already have, this database is .xls.

    thank you for your help. this forum is grate

  4. #4
    jessicams16863's Avatar
    jessicams16863 is offline x10Hosting Member jessicams16863 is an unknown quantity at this point
    Join Date
    Aug 2011
    Location
    北京,中国
    Posts
    3

    Re: ¿how to join a database with a website?

    Well, an XLS is an Excel spreadsheet. An excel spreadsheet is not a "database" as programmers or web developers are used to using. For example, x10 supports PostGreSQL and MySQL. You access data from this software by creating tables in SQL, then querying them with SQL (structured query language).

    A scripting language like PHP is really easy to deploy. It's as easy as writing some code and uploading it to an Apache server (like x10 uses) that uses PHP as a ".php" file. The PHP code would query that database for whatever data you want to be displayed.

    There are other ways to go about it, if it's not for a complex application, you could convert your spreadsheet to HTML, for example. But, the solution you want depends on your needs. Either way, I am a programmer, so I only know a programmer's perspective. There might be someone here that knows some software that can automate this for you.

  5. #5
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: ¿how to join a database with a website?

    Actually, an Excel sheet can be a database. MS Excel is (or, rather, was) as direct feature-compatible competitor to Lotus 1-2-3, and the 1, 2 and 3 of Lotus 1-2-3 were "spreadsheet", "database" and "business graphics". The VLOOKUP function is part of Excel's database module. It's a common mistake to conflate "database" with "RDBMS"; not all databases are relational (and none of my favorites are, though I've gotten used to shoehorning fundamentally non-relational data into something like MySQL for low-end web development -- or worse, something like Oracle for enterprises that need to feel they're getting their money's worth out of their license).

    That being said, the problem here is the database engine. In order to use an Excel sheet as a database adjunct to a web application, you need a runtime engine that can read and write Excel. That's not going to happen on free or low-cost shared web hosting on a LAMP (Linux, Apache, MySQL, PHP) stack. You need to move the data to a different database -- either MySQL or SQLlite (PostgreSQL isn't supported on free hosting here, though it is on paid plans). MySQL is probably the batter option, not because it's the best fit for your data, but because nearly everybody here is using it in one way or another so it's a lot easier to get help when you need it. (And there are a lot of books and websites that can offer additional help, though many of them are based on older versions, outdated methods and "cargo cult" programming techniques.)

    The simplest way to do things would probably be to dump your Excel sheet to a CSV (comma-separated values) file and import it into MySQL. Simplest, but nowhere near best. You'll want to spend some time first designing the database (which, at this point, is probably nothing more than a single table). That means taking the time to figure out what data types each of the columns ought to contain, and determining the sizes needed to suit (integers, long integers, floating point numbers, text columns with a maximum length), which columns are (and which are not) allowed to be empty (or NULL), which are going to be used regularly for lookups (they should be indexed) and which are knowably unique for each entry (the primary key, and that may be something you need to impose on data that don't naturally contain unique values).

    There is really far too much to cover in a general reply -- one could easily write a thousand-page book that just skims the surface (and many have). If you want any real help, then you need to make you question a lot more specific. What do the data look like? Where do you want to use them? How are you planning to determine what the user can see (is it based on a login, the time of day, day of the year, etc.)?

    It's not just a matter of "hooking things up"; there's programming and database design involved.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

+ Reply to Thread

Similar Threads

  1. users can join in to my website
    By bludemonjr14 in forum Free Hosting
    Replies: 1
    Last Post: 06-25-2011, 12:10 AM
  2. Tables Join Database
    By supersonic in forum Free Hosting
    Replies: 1
    Last Post: 11-17-2008, 04:18 PM
  3. farcry 2 fan website come and join
    By farcryfan132 in forum Review My Site
    Replies: 4
    Last Post: 07-29-2008, 04:42 PM
  4. farcry 2 fan website come and join
    By farcryfan132 in forum Gamer's Lounge
    Replies: 1
    Last Post: 07-29-2008, 08:26 AM
  5. Credits to join website
    By GamingX in forum The Marketplace
    Replies: 32
    Last Post: 10-29-2007, 07:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers