SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql_fetch_array(): supplied argument is not ...

    I know my table name is right cause I copied-pasted it right out of phpmyadmin. Also, when I change the table name to some other one, it works fine. What is the problem here?

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/the-barr/public_html/wotr/game.php on line 25
    Line 25 is

    Code:
    while ($Row = mysql_fetch_array ($Result)) {
    Code:
    <? include("/home/the-barr/public_html/v3/header.php") ?>
    
    
    
    <?php
    $Host = "localhost";
    $User = "*****";
    $Password = "******";
    $DBName = "thebarr_content";
    $TableName = "WotR";
    
    $Link = mysql_connect ($Host, $User, $Password);
    
    $Query = "SELECT * from $TableName ORDER BY Culture";
    
    $Result = mysql_db_query ($DBName, $Query, $Link);
    
    // Create a table.
    print ("<TABLE WIDTH=\"60%\" BORDER=1 BORDERCOLOR=#000000 CELLSPACING=0 CELLPADDING=4 ALIGN=CENTER  class=content>\n");
    print ("<TR ALIGN=CENTER VALIGN=TOP>\n");
    print ("<TD ALIGN=CENTER VALIGN=TOP colspan=1>Minor Gods</TD>\n");
    print ("</TR>\n");
    
    // Row God and Row Strat are switched around
    while ($Row = mysql_fetch_array ($Result)) {
     	print ("<TR ALIGN=CENTER VALIGN=TOP>\n");
     	print ("<TD ALIGN=center VALIGN=center WIDTH=\"75px\">'.$Row[Name].'</TD>\n");
     	
     	print ("</TR>\n");
     
    }
    mysql_close ($Link);
    print ("</TABLE>\n");
    ?> 
    
    
    
    <? include("/home/the-barr/public_html/v3/footer.php") ?>

  2. #2
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may not have a valid connection, try this...
    PHP Code:
    $Link mysql_connect ($Host$User$Password or die(mysql_error()); 
    Lats...


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
  •