SitePoint Sponsor

User Tag List

Results 1 to 1 of 1

Thread: tables?

  1. #1
    SitePoint Zealot Fizlar's Avatar
    Join Date
    Aug 2003
    Location
    Sheffield
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tables?

    Sorry this is not really a major problem for most of them but i have been trying for hours to do this

    basically i want the results of the query to go into a table and have a button on each one to allow users to display full records but at the moment i cant do either i keep getting thousand of errors

    here is the code and the (***) is the part i want to be in a table can some one help please

    thanks in advanced

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Burngreave.net Course Search</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    </head>
    <P>Today's Date is
    <?php
    echo( date("l, F dS Y.") );
    ?>


    <SCRIPT language="JavaScript">
    <!--

    var current = 0
    var x = 0
    var speed = 100
    var speed2 = 2000

    function initArray(n) {
      this.length = n;
      for (var i =1; i <= n; i++) {
        this[i] = ' '
      }
    }
    typ = new initArray(3)
    typ[0]="BURNGREAVE.NET"
    typ[1]="COURSE FINDER"
    typ[2]="A FIZLAR WEBSITE"



    function typewrite() {
    var m = typ[current]

    window.status = m.substring(0, x++) + "_"

    if (x == m.length + 1) {
    x = 0
    current++

    if (current > typ.length - 1) {
    current = 0
    }

    setTimeout("typewrite()", speed2)
    }

    else {
    setTimeout("typewrite()", speed)
    }
    }

    typewrite()
    //-->

    function typewrite() {
    var m = typ[current]

    window.status = m.substring(0, x++) + "_"

    if (x == m.length + 1) {
    x = 0
    current++

    if (current > typ.length - 1) {
    current = 0
    }

    setTimeout("typewrite()", speed2)
    }

    else {
    setTimeout("typewrite()", speed)
    }
    }

    typewrite()
    //-->

    </script>
    <body bgcolor="#663399">
    <h1><strong><font color="#CC0000" size="+5" face="Georgia, Times New Roman, Times, serif">Burngreave.net</font></strong></h1>
    <blockquote> 
      <blockquote> 
        <blockquote> 
          <blockquote> 
            <blockquote> 
              <blockquote> 
                <blockquote> 
                  <blockquote> 
                    <blockquote> 
                      <p><font color="#CC0000" size="+7"><em>course finder</em></font></p>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
    <p> 
    <form method=post action="search.php"> 
      <p> <font color="#0000FF"><strong>Please enter the course You are looking for</strong></font>: 
        <input type=text name=QUERY size=50 maxlength=50> <input type=submit> 
    <p> 
                                            
    </form> 



    //search.php 
    <? 
    $user 
    "fizlar";
    $pass "burngr34ve ";
    $db "fizlar1";
    $link mysql_connect"localhost"$user$pass );
    if (! 
    $link)
        die (
    "could not connect to MySQL");
    print 
    "sucessfully connected to server<p>";
    mysql_select_db ($db)
        or die (
    "could not connect to $db: ".mysql_error() );
    print 
    "successfully selected database \"$db\"<p>";

    if (
    $user == ""
    {
    $user '%';} 

    $result mysql_query ("SELECT * FROM USER_QUERY, USER_ALTERNATIVE 
                             WHERE QUERY LIKE '%
    $QUERY%' AND USER_QUERY.USER_QUERY_ID = USER_ALTERNATIVE.USER_QUERY_ID
                           "
    ); 

    if (
    $row mysql_fetch_array($result)) { 

    do { (******)
      PRINT 
    "<b>DID YOU MEAN THIS?:       </b>  ";
      print (
    "<p>"); 
      PRINT 
    "<b>COURSE:     </b>     "
      print 
    $row["ALTERNATIVE_PHRASE"]; 
      print (
    " "); 
      PRINT 
    "<b>LOCATION:     </b>     "
      print 
    $row["NAME_OF_ORGANISATION"]; 
      print (
    " "); 
      PRINT 
    "<b>COURSE ID:     </b>     "
      print 
    $row["COURSE_ID"]; 
      print (
    "<p>"); 
    } while(
    $row mysql_fetch_array($result)); 
    } else {print 
    "Sorry, no records were found!";}   
      

    ?>
    Last edited by redemption; Aug 28, 2003 at 23:05. Reason: Edited to enclose code in [php] tags


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
  •