SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Query works in one browser, get "Argument Not Valid MySQL Result Resource" in other

    I am baffled. Why do I have this error with Windows Explorer and intermittently with another browser, but it seems to work without this warning most of the time with Mac FireFox? Should have nothing to do with the browser. The only browser connection to server side scripts that comes to mind is whether or not a session is destroyed.

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource $query = "SELECT * FROM packages";

    Code:
    $result = mysql_query($query) or die('bird song: ' . mysql_error(). "<br>\nQuery: $query");
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
    $price_ea = explode(",",$row['pricing_package']);
    $j=0;
    $id = $row['id_package'];
    foreach ($price_ea as $value)
    {
    $j++;
    $pricing["$id"]["$j"] = $value;
    if($j_max<$j) // $j_max is the max number of increments in pricing structure for any package
    {$j_max=$j;}
    }
    }
    There are no dead atheists.

  2. #2
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry folks - turns out I was accessing two different scripts when testing the code from browser to browser. Accidentally put the wrong URL into one of the browsers, accessing the older version of the same script. False alarm.

    Moderator - please remove this thread.
    There are no dead atheists.


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
  •