SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Evangelist ColinHughes's Avatar
    Join Date
    Sep 2004
    Location
    Spain
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Delete works on my test server and not on my production server?

    PHP Code:
     $sql "SELECT `propertyref` FROM `feed_property` WHERE `status` = 'Sold' OR `status` = 'Off Market' ";
        
    $result $db->query($sql);

        if (isset(
    $result)):
            while (
    $row $result->fetch_array(MYSQLI_ASSOC)):
                
    $ref1 $db->real_escape_string($row['propertyref']);

                  
    $query1 "DELETE FROM `feed_property`, `feed_images`, `feed_characteristics`\n"
                
    "USING `feed_property` INNER JOIN `feed_images` INNER JOIN `feed_characteristics`\n"
                
    "WHERE feed_property.propertyref = '$ref1'\n"
                
    " AND feed_images.propertyref = feed_property.propertyref\n"
                
    " AND feed_characteristics.propertyref = feed_property.propertyref; ";
                
                
                
                
    $db->query($query1);

            endwhile;
        endif; 
    I cannot understand why the delete query works on my test server but not on my production server? On the latter it deletes the images and characteristics associated with an off market or Sold property, but it will not delete the property itself.



    Any insight as to why this might be?

    TIA

  2. #2
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,094
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    All I can think of is that your production server may have limited database privileges.
    In phpmyadmin, click on the Privileges tab to see what you are allowed to do.
    What I lack in acuracy I make up for in misteaks

  3. #3
    SitePoint Evangelist ColinHughes's Avatar
    Join Date
    Sep 2004
    Location
    Spain
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do not have access to the privileges tab, shared hosting. Can you explain why this would be the problem it deletes 2 of the 3 "FROMS" in the query?

  4. #4
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,094
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    At first I read the title and did not get that is was leaving one entry.
    Could it be that you are missing \n ant the end of $query1?
    What I lack in acuracy I make up for in misteaks


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
  •