SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: PHP and HTML

  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP and HTML

    I have a DB created in Filemaker. I have download PHP pad. I want to create a search feild. I want to be able to type in a course number and have it pull out the books it needs for that class from the db(filemaker) and list the books that course id needs. Can anybody help me figure this out?

    I am using Filemaker's Custome web publishing engine and need to pull information out of the DB using php and write code in HTML. Help please.

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe someone can recomend you a book to help you learn php and mysql.

    bump

  3. #3
    SitePoint Enthusiast The buzzing bee's Avatar
    Join Date
    Sep 2005
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is in your database? I would make a table called 'books' listing all the books with four columns - 'id', 'courseidsneededfor', 'nameofbook', and 'nameofauthor'. I would then have another table called 'courses' for listing all the courses with two columns - 'id' and 'nameofcourse'. Then create your form in HTML, with a sumbit button called 'submit' and a text box called 'typein'. I would then do something like this. Disclaimer: I am quite new to PHP and have not checked this code, so use with caution!

    PHP Code:
    <?php

    if(isset($_POST['submit'])) and ($_POST['typein'])!=""){
    $course mysql_query ("SELECT * FROM courses WHERE nameofcourse == ($_POST['typein'])"$connection);

    $results mysql_query ("SELECT * FROM books WHERE courseidsneededfor LIKE ($course[1])"$connection);

    echo=
    "<TABLE>"
    while($row mysql_fetch_row($results))
    {
    echo=
    "<TR><TD><P>".$row[2]."</P></TD><TD><P>".$row[3]."</P></TD></TR>
    }
    echo="
    </TABLE>"
    ?>
    The Buzzing Bee
    web@nerdshack.com

    "I'll live forever or die trying"

  4. #4
    SitePoint Enthusiast The buzzing bee's Avatar
    Join Date
    Sep 2005
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oops, forgot to close the if. put in a } at the end just before the ?>
    The Buzzing Bee
    web@nerdshack.com

    "I'll live forever or die trying"


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
  •