SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Help me please

  1. #1
    SitePoint Member Lukus's Avatar
    Join Date
    Oct 2001
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help me please

    Can ne1 tell me what is wrong with this code pls:

    PHP Code:
    <html>
    <head><title>Web Database Sample Inserting</title>
    </head> 
    <?php
    include ("connect.php");
    ?>
    <body bgcolor=#ffffff>

    <?
        
    if (isset($band) && isset($song) && isset($album)) {
        
            
    $query "INSERT INTO music VALUES ('$band', '$song', '$album')";
            
    $result mysql_db_query("divinekorn"$query); 

        if (
    $result) {
            echo 
    "<p>$band     was added to the database</p>";
        }
    ?>

    <h1>Add an entry</h1>
    <form method="post">
      Name: 
      <input type=text name='name'><br>
    Phone: <input type=text name='phone'><br>
    <input type=submit>
    </form>
    <p><a href="index.php">Back to index</a>
    </body>
    </html>
    The error i keep getting says:
    Parse error: parse error in /web/sites/261/lukusdesigns/www.lukusdesigns.f2s.com/add.php on line 29

    Line 29 is the </html> part of the script

    help wud be very much appreciated

    thanks

  2. #2
    epsilon transition cupid's Avatar
    Join Date
    Aug 2001
    Location
    Kent, Ohio
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're missing a closing bracket (}) for the first if-statement.

    Should be like this:
    PHP Code:
    <?
        
    if (isset($band) && isset($song) && isset($album)) {
        
            
    $query "INSERT INTO music VALUES ('$band', '$song', '$album')";
            
    $result mysql_db_query("divinekorn"$query); 

        if (
    $result) {
            echo 
    "<p>$band     was added to the database</p>";
        }
    }
    ?>
    Last edited by cupid; Oct 22, 2001 at 14:08.

  3. #3
    SitePoint Member Lukus's Avatar
    Join Date
    Oct 2001
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks m8


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
  •