Multiple Pages from one PHP document

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neil Trigger

    #1

    Multiple Pages from one PHP document

    Hiya,
    I'm trying to work out how to query a database in MySQL, get a nuumber of
    listings that match some of the criteria. For example the database has a
    "town" field. If the town field matches the form's town field (as input from
    the user), that listing's "Title" field is printed.

    This title should act as a link to the full information of the listing. EG.

    The user enters "Plymouth" as the town,
    The php sends a query to the database
    The database says "yes we have 10 listings in plymouth" and lists the titles
    of all 10 as links.
    The user clicks on one of the titles named "Neil's House"
    The php then sends a query to the database and prints all the details of
    this listing including "Descriptio n" and "Directions " fields.

    I hope that makes sense, but anyone have any ideas HOW to do it?

    I have a feeling I'll need to add includes or if / else statements to only
    print the whole listing if the database is certain it has the listing
    required, but otherwise keep giving details until only one is listed.

    Also is it possible to create an SQL database from an Excell spreadsheet?

    Thanks.
    --
    ¿ Trigger ?




  • Tim Van Wassenhove

    #2
    Re: Multiple Pages from one PHP document

    On 2003-12-17, Neil Trigger <email@magic2k. com> wrote:

    As said before: Don't multi-post.

    --
    verum ipsum factum

    Comment

    • Geoff Berrow

      #3
      Re: Multiple Pages from one PHP document

      I noticed that Message-ID:
      <V0WDb.21383$5F 2.9013@news-binary.blueyond er.co.uk> from Neil Trigger
      contained the following:
      [color=blue]
      >
      >The user enters "Plymouth" as the town,
      >The php sends a query to the database
      >The database says "yes we have 10 listings in plymouth" and lists the titles
      >of all 10 as links.
      >The user clicks on one of the titles named "Neil's House"
      >The php then sends a query to the database and prints all the details of
      >this listing including "Descriptio n" and "Directions " fields.
      >
      >I hope that makes sense, but anyone have any ideas HOW to do it?[/color]

      The database will have returned rowIDs for each row returned so end the
      row ID information in the URL e.g.

      <a href="details.p hp?rowID=12345" >Neil's House</a>

      The variable will be passed to details.php as $_GET["rowID"] and you can
      then use it as the WHERE part of an SQL query.[color=blue]
      >
      >Also is it possible to create an SQL database from an Excell spreadsheet?[/color]

      Yes, just save it as a csv file. You might have to google round for an
      import script.
      --
      Geoff Berrow (put thecat out to email)
      It's only Usenet, no one dies.
      My opinions, not the committee's, mine.
      Simple RFDs http://www.ckdog.co.uk/rfdmaker/

      Comment

      • Neil Trigger

        #4
        Re: Multiple Pages from one PHP document

        I think I'm beginning to understand multi posting. I found someone who
        wrote:

        "As said before: Don't multi-post.

        --
        verum ipsum factum

        In more than one newsgroup."

        Is this multi posting?

        --
        ¿ Trigger ?




        Comment

        Working...