SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    May 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    msql error why?????

    this is the error :
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in index.php on line 147

    this the code:
    break;
    case "10":

    $result = mysql_query("SELECT pr_code, pr_totbedrooms, pr_name, pr_sellingprice, pr_descuk, (select prtypology_uk from prtypology where prtypology_code=$criteria_property) AS property_type FROM property WHERE (property.pr_type='0$criteria_property,' OR property.pr_type LIKE '%,0$criteria_property,%' OR property.pr_type LIKE '%$criteria_property,%') AND property.pr_publishonottk=-1");

    $num = mysql_num_rows($result);

    echo "<h2>Found objects: $num </h2>";

    if ($num>10){

    -----------------------------
    why does it work on some server and some of them it don't please help

  2. #2
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try testing your SQL in phpMyAdmin.

    MySQL questions go in the MySQL forum btw.

    Douglas
    Hello World

  3. #3
    SitePoint Evangelist ClickHeRe's Avatar
    Join Date
    Mar 2005
    Location
    Ottawa, Canada
    Posts
    580
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $result mysql_query("SELECT pr_code, pr_totbedrooms, pr_name, pr_sellingprice, pr_descuk, (select prtypology_uk from prtypology where prtypology_code=$criteria_property) AS property_type FROM property WHERE (property.pr_type='0$criteria_property,' OR property.pr_type LIKE '%,0$criteria_property,%' OR property.pr_type LIKE '%$criteria_property,%') AND property.pr_publishonottk=-1");

    if ( 
    mysql_errno() > ) {
      echo 
    mysql_error( );
      exit;


  4. #4
    &lt;!-- Insert thoughts here --&gt; pitcher17's Avatar
    Join Date
    Apr 2004
    Location
    The great white north
    Posts
    293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why does it work on some server and some of them it don't please help
    Older versions of mysql have different capabilities. Subqueries are one of those things.
    The more time I save by not planning and documenting,
    the more time I have left to debug.



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
  •