Announcement

Collapse
No announcement yet.

Searchable database

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Searchable database

    Hi

    Could you tell me what is involved in creating a searchable database. please?

    What (I think...) I need is a drop-down menu (html) with a list of countries, which in turn opens another list of cities. On clicking on a particular city a search takes place in a database and returns what it finds (a list of providers) to a new webpage.

    I assume that...

    I have to create a database (in what format?)
    I need some sort of script (where do I get it?)

    I know there are no simple answers but just give me the outline, if possible, please.

    Many thanks

  • #2
    Hi there qim,

    Could you tell me what is involved in creating a searchable database. please?
    1. Install a server locally on your P.C.
    2. Learn PHP and MySQL


    ~ the original bald headed old fart ~

    Comment


    • #3
      Hi coothead

      I'm surprised that I need to install a local server

      At the very beginning I had a database for clients to register and if I remember it was all done automatically within the server. (I expect I still have the files somewhere)

      meanwhile today I have been trying (unsuccessfully, as always) to connect to a newly created database and I'm stuck with the php, which I'm starting to think is rather old.

      Could you have a look at it, please?

      [HTML<?php


      $user_name = "pintotou_***";
      $password = "****";
      $database = "pintotou_***";
      $server = "localhost";

      $db_handle = _connect($server, $user_name, $password);

      $db_found = _select_db($database, $db_handle);

      if ($db_found) {

      $SQL = "SELECT * FROM tb_Chains";
      $result = _query($SQL);

      while ( $db_field = _fetch_assoc($result) ) {

      print $db_field['ID'] . "<BR>";
      print $db_field['Chain'] . "<BR>";
      print $db_field['Country'] . "<BR>";
      print $db_field['City'] . "<BR>";
      print $db_field['Top'] . "<BR>";
      print $db_field['Medium'] . "<BR>";
      print $db_field['Low'] . "<BR>";
      }

      _close($db_handle);

      }
      else {

      print "Database NOT Found ";

      }

      ?>
      [/HTML]

      I think that half the problem is that I am confusing the name of the database with the name of the table

      Regards
      Last edited by qim; 11-27-2015, 08:25 AM.

      Comment


      • #4
        I'm trying to guess why you mentioned installing a local server.

        One I get things sorted out with the new database at the server (i'm still testing conncetion) I guess that I have to replicate the database in the PC to enter all the data, before uploading the lot.

        is that it?

        Comment


        • #5
          Above PHP

          SOLVED

          Comment


          • #6
            Hi there qim,

            I'm trying to guess why you mentioned installing a local server.
            I suggested it because it is a handy tool to have if you
            are going to learn about and work with PHP and MySQL.

            Obviously, your host provides PHP and MySQL, but it is
            easier and more convenient to test the coding locally.

            It is also Free.


            ~ the original bald headed old fart ~

            Comment


            • #7
              I downloaded something called HeidiSQL. I have no idea if it any use.

              If I went back to the late 70s when the databases were in ascii characters separated by a comma I could use Notepad to insert all the data in the PC and then somehow upload it to the database at the server.

              is this still possible?
              Last edited by qim; 11-27-2015, 12:08 PM.

              Comment


              • #8
                Hi there qim,

                I really have no knowledge, I am sorry to say, about either of your two questions.

                My knowledge of PHP I regard as minor and of MySQL as rather less than that .

                I only start to feel comfortable when confronting CSS, HTML and JavaScript problems.


                ~ the original bald headed old fart ~

                Comment


                • #9
                  This is not so much about programming, but about writing.

                  I assume that I can use Notepad to write all the records, one in each line, and I read that they should be tab separated (that's called progress; in the dark ages of computers they were comma separated!).

                  I also read, and could not understand how or where that the upload could be done with

                  It should be as simple as...
                  LOAD DATA INFILE '/tmp/mydata.txt' INTO TABLE PerformanceReport;

                  By default LOAD DATA INFILE uses tab delimited, one row per line, so should take it in just fine.

                  If it makes any sense to you, let me know.

                  Regards

                  Comment


                  • #10
                    I assume you've managed to resolve this?
                    Who needs a Signature?

                    Comment

                    Working...
                    X