SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql_query() error

    Nobody seems to be able to figure this out so I'll bring this error to you all.

    Error:
    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/*** on line 23

    Code:
    $cxn = mysql_connect($host, $user, $password, $dbname);
    $sql = "SELECT * FROM `results` WHERE `athlete_id` = 81";

    $result = mysql_query($cxn,$sql); <===== LINE 23
    var_dump($result_1);


    The connect works, it seems to be the query yet, I got that Query code be generating it in phpMyAdmin.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look closely at what the first argument to mysql_query() is supposed to be.
    http://www.php.net/mysql_query

  3. #3
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh wow.... yeah got it... was using mysqli before and didnt catch that


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
  •