SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    ? big bad opus's Avatar
    Join Date
    Jun 2001
    Location
    DC
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    i'm a big dummy, help me

    PHP Code:
    $tablename "songs";

    $link mysql_connect($host$user$password);

    $query "INSERT into $tablename values ('0','$array[artist]','$array[songtitle]','$array[file]','$array[review]','$array[date]','0','1')";

    print(
    "your query is:<br> $query <p>\n");

    if (
    mysql_db_query($query$dbname$link)) {
        print(
    "thanks, the audio was added successfully<br>\n");
    }else{
        print(
    "you messed up, try again<br>\n"); 
    }

    mysql_close($link);

    ?> 
    can anyone tell me why this isn't working? i keep getting the "you messed up, try again" message.

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try adding this somewhere in your code:

    echo mysql_error();

    And tell us what the error message is.

  3. #3
    ? big bad opus's Avatar
    Join Date
    Jun 2001
    Location
    DC
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mysql_db_query was mixed up. i fixed it and it works now.


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
  •