#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    San Antonio, Texas, USA
    Posts
    23
    Rep Power
    0
    I am having trouble with this script, it says there is a problem on lines 13 and 14, can anyone help me?

    ============================================
    <?
    include("http://www.toxicmusic.com/include/common.inc");
    $title = "$artist";
    include("http://www.toxicmusic.com/include/header.inc");
    ?>

    <?

    $db = mysql_connect("localhost", "toxic" , "relysis01");
    mysql_select_db(toxic);

    //variable $artist automatically set
    $result = mysql_db_query("select artist,biography,members from artist where artist='$artist'");
    if (list($artist,$biography,$members) = mysql_fetch_row($query))
    {
    echo "<font face=veredana size=2><b>$artist</b></font><br><br>n";
    echo "<font face=veredana size=1>Members<br>$members<br><br>n";
    echo "$members<br>n";
    }
    else
    {
    echo "Artist $artist not foundn";
    }
    ?>

    <?
    include("http://www.toxicmusic.com/include/footer.inc");
    ?>

    =============================================
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Seaside, CA
    Posts
    84
    Rep Power
    15
    Just a guess, and not knowing what the error message was, but you've misspelled the font name.

    ------------------
    From the day we're born, we're running out of time.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    San Antonio, Texas, USA
    Posts
    23
    Rep Power
    0
    Nope I fixed the font name and it still doesnt work, here is the error message

    Warning: Wrong parameter count for mysql_db_query() in /usr/local/webs/toxicmusic/artists/index.php3 on line 13

    Warning: Supplied argument is not a valid MySQL result resource in /usr/local/webs/toxicmusic/artists/index.php3 on line 14
    Artist not found
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    45
    Rep Power
    15
    You are missing one argument to your call in mysql_query_db . You need to use the $result variable, as shown...

    Line 13: $result = mysql_db_query($result,"select artist,biography,members from artist where artist='$artist'");

    that should clear up both error messages. You might just want to use mysql_query in the future, unless there's a specific reason you need to use mysql_db_query .
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    San Antonio, Texas, USA
    Posts
    23
    Rep Power
    0
    That took away one error message but i still have this one

    Warning: Supplied argument is not a valid MySQL result resource in /usr/local/webs/toxicmusic/artists/index.php3 on line 14
    Artist not found

    Line 14 is this

    if (list($artist,$biography,$members) = mysql_fetch_row($query))

    Any idea what the problem could be?

  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    try

    if (mysql_num_rows($result) > 0) {

    while ($myrow = mysql_fetch_array($result)) {
    print "<font face=veredana size=2><b>". $myrow["artist"] ."</b></font><br><br>n";
    echo "<font face=veredana size=1>Members<br>". $myrow["members"] ."<br><br>n";
    echo $myrow["members"] ."<br>n";

    }

    }

    else {

    print "No records found!";
    }
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    San Antonio, Texas, USA
    Posts
    23
    Rep Power
    0
    Here's what I get now

    Warning: Supplied argument is not a valid MySQL result resource in /usr/local/webs/toxicmusic/artists/index.php3 on line 14

    Here's line 14

    if (mysql_num_rows($result) > 0) {

    This is driving me crazy! Please help.

  14. #8
  15. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    if (list($artist,$biography,$members) = mysql_fetch_row($query))
    >>

    that was wrong ..where is the "$query" variable?

    --------
    try the following:

    <?
    $db = mysql_connect("localhost", "toxic" , "relysis01");
    mysql_select_db(toxic,$db);

    //variable $artist automatically set
    $result = mysql_query("select artist,biography,members from artist where artist='$artist'",$db);

    if(mysql_num_rows($result)>0){

    while($row= mysql_fetch_array($result)){
    echo "<font face=veredana size=2><b>".$row["artist"]."</b></font><br><br>n";
    echo "<font face=veredana size=1>Members<br>".$row["members"]."<br><br>n";
    }
    }
    else
    {
    echo "Artist $artist not foundn";
    exit;
    }
    ?>


    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited July 26, 2000).]

Similar Threads

  1. Trouble adding new bound textbox to form (Access VBA)
    By Cuku in forum Visual Basic Programming
    Replies: 1
    Last Post: November 18th, 2003, 08:50 AM
  2. having trouble with Line Input Routine
    By trdmuffin in forum C Programming
    Replies: 3
    Last Post: November 17th, 2003, 08:44 PM
  3. Having trouble with an OS game
    By drucey in forum C Programming
    Replies: 6
    Last Post: October 31st, 2003, 10:05 AM
  4. Hello! Having trouble with an opensource game
    By drucey in forum Java Help
    Replies: 0
    Last Post: October 31st, 2003, 06:59 AM
  5. Sessions trouble.
    By GoBieN in forum PHP Development
    Replies: 7
    Last Post: August 5th, 2003, 10:16 PM

IMN logo majestic logo threadwatch logo seochat tools logo