Results 1 to 2 of 2

Thread: Error - MySQL Array

  1. #1

    Thread Starter
    Addicted Member articwoof's Avatar
    Join Date
    Oct 2004
    Location
    Alaska
    Posts
    163

    Error - MySQL Array

    PHP Code:
    <?php    @mysql_connect(localhost,USER,PASS) or die(mysql_error()); 

        
    mysql_select_db(DATABASE) or die(mysql_error()); 

        
    $query "SELECT * FROM `config`"
        
    $result mysql_query($query);  
        while(
    $r=mysql_fetch_array($result))     
        { 
        
    ?>
    I keep getting an error on:
    PHP Code:
    while($r=mysql_fetech_array($result)) 
    "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource..."
    Please help me with this.

    The database is setup and tables are correct.
    [+] - My Portfolio/Blog :: RattleSoft

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Error - MySQL Array

    The query on the database failed. You should check for this everytime you execute an SQL query. Your problem is caused by the back ticks `, they should only be used for field names:
    PHP Code:
    if (! $result mysql_query($query)) {
        die(
    mysql_error());

    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width