Jump to content

clem_c_rock

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Posts posted by clem_c_rock

  1. Hello,

      I have this large inner join query that is causing frequent timeouts on our server and I was wondering if there was anyway I could streamline it so it would work all the time.  The strange thing is that when I copy and paste this query into phpMyAdmin, it runs in 0.0711.  I've tried many different versions of this as a regular join table and this query below:

     

    SELECT property.property_id, property.acres, property.addr2, property.agent_id, property.appl_fee, property.agency_id, property.built, property.city, property.clubhouse_onsite, property.contact_rental, property.contact_repair, property.contact_security, property.current_hits, property.description, property.display_priority, property.elem_school, property.fitness, property.gated_entrance, property.last_view_date, property.laundry, property.fenced_yard, property.patio, property.car_port, property.util_water, property.lease_week, property.lease_year, property.list_address, property.location_id, property.market_id, property.max_income, property.middle_school, property.min_income, property.modify_date, property.num_tenants, property.pet_bool, property.pet_fee, property.pet_policy, property.photo1, property.photo1_capn, property.photo2, property.photo2_capn, property.playground, property.pool, property.title, property.public_trans, property.school_dist, property.two_car_garage, property.one_car_garage, property.state, property.storage, property.street_num, property.street_name, property.tax_credit, property.template, property.tennis_courts, property.unit_num, property.util_cable, property.util_electric, property.util_gas, property.util_included, property.util_lawn, property.util_oil, property.well_water, property.util_pool, property.util_trash, property.city_water, property.why_removed, property.zip4, property.zip5, property.page_title, property.page, property.available_date, property.garage, property.util_phone, property.util_heat, property.util_hot_water, property.allow_dogs, property.allow_cats, property.site_id, property.prop_type, property.specials, property.section_8, property.screened_porch, property.deck, property.deck_storage, property.patio_storage, property.available_str, property.storage_room,property.court_yard, layout.layout_id, layout.appl_fee, layout.ac, layout.always_avail, layout.area, layout.basement, layout.bath, layout.beds, layout.deck, layout.carpet, layout.central_hvac, layout.patio, layout.deposit, layout.layout_description, layout.fireplace, layout.floorplan, layout.fridge, layout.furnished, layout.garbage_disp, layout.dining_room, layout.hardwood_floors, layout.heat_pump, layout.layout_title, layout.list_search, layout.list_begin_date, layout.list_end_date, layout.num_units, layout.parking, layout.pet_fee, layout.photo, layout.photo_capn, layout.rent, layout.rent_high, layout.rooms, layout.central_oil_heat, layout.screen_patio, layout.dishwasher, layout.central_gas, layout.stove, layout.ceiling_fan, layout.central_electric, layout.total_hits, layout.washer_dryer, layout.wd_hookups, layout.yard, layout.jacuzzi, layout.agency_id, layout.walk_in_closets, layout.microwave, layout.util_phone, layout.attic, layout.dryer_conns, layout.den,layout.family_room,layout.bonus_room, layout.new_carpet, layout.unfin_basement, layout.gas_space_heater, layout.washer_conns, layout.electric_baseboard_heat,layout.zip,layout.specials, layout.storage, layout.fenced_yard, layout.one_car_garage, layout.two_car_garage,layout.water_included, layout.page,layout.layout_photo_capn,layout.wall_ac, layout.electric_heat FROM property INNER JOIN layout ON layout.property_id = property.property_id WHERE (property.property_id=125 AND layout.property_id=125)
    
    while($row = mysql_fetch_assoc($result)){ $db_vars[] = $row; }
    $db_vars = $db_vars[0];
    

     

    Any help would be greatly appreciated.

  2. Hello,

        I just ported a site over to a new server w/ a newer version of php. 

     

    I am having a strange problem using the extract() function to extract contents of a mysql_fetch_array.

     

    I know it's the extract function because when I comment it out the page loads with no problem.

     

    here's my code:

     

    $sql_select = "select property.*, layout.* from property,layout where property.property_id=$property_id and layout.property_id=$property_id";
    $result = mysql_query ($sql_select, $conID); 
    
    $row = array();          
    while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ extract($row); } 
    

     

    Any ideas on why this is happening?

     

    thanks for your time!

  3. Hello,

      I have a script that suddenly stopped working and nothing's been changed.      I am using the php mail() function to send a simple email form and the mail() function report true when it is fired off but I can never receive the emails.

     

    I suspect something's changed in our hosting but wanted to rule everything out before I started investigating there.

     

    Here's the simple code I am using:

     

     

      $send_tenant_mail = mail( $tenant_email, $subject, $body_header, "From: $from\nReply-To: $from\n" );
              if($send_tenant_mail == 1)
      { 
          $confirm = "A Confirmation Email has been sent to: $tenant_email";
      }
    

     

     

    Thanks,

    Clem C

  4. One thing I should mention, when I start commenting out the module includes the next one in line shows up as 'garbled'.   

     

    Behold:

     

    When I comment out line #66 it just says the next module is garbled:

     

    httpd: Syntax error on line 67 of /etc/apache2/httpd.conf: API module structure `cache_module' in file /usr/lib/apache2/modules/mod_cache.so is garbled - perhaps this is not an Apache module DSO?

     

    and if I comment out line 68 I get:

     

    httpd: Syntax error on line 68 of /etc/apache2/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_mem_cache.so into server: /usr/lib/apache2/modules/mod_mem_cache.so: undefined symbol: apr_atomic_dec

     

    and then I comment out the next one I get:

    httpd: Syntax error on line 71 of /etc/apache2/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_ext_filter.so into server: /usr/lib/apache2/modules/mod_ext_filter.so: undefined symbol: apr_poll_socket_add

     

    and so on.

     

    Something is all messed up.

  5. Here's what I got when I ran  dpkg --list | grep php:

     

     

    ii  libapache2-mod-php5    5.1.2-1ubuntu3.9            server-side, HTML-embedded scripting languag

    ii  php5                  5.1.2-1ubuntu3.9            server-side, HTML-embedded scripting languag

    ii  php5-common            5.1.2-1ubuntu3.9            Common files for packages built from the php

    ii  php5-mysql            5.1.2-1ubuntu3.9            MySQL module for php5

    ii  php5-mysqli            5.1.2-1ubuntu3.9            MySQL Improved module for php5

    ii  phpmyadmin            2.8.0.3-1                    set of PHP-scripts to administrate MySQL ove

     

  6. This is what I have around line 66 (I don't see anything wrong on line 66)

     

    LoadModule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so

    LoadModule authn_dbm_module /usr/lib/apache2/modules/mod_authn_dbm.so

    LoadModule authn_anon_module /usr/lib/apache2/modules/mod_authn_anon.so

    LoadModule authn_dbd_module /usr/lib/apache2/modules/mod_authn_dbd.so

    LoadModule authn_default_module /usr/lib/apache2/modules/mod_authn_default.so

    LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so

    LoadModule authz_groupfile_module /usr/lib/apache2/modules/mod_authz_groupfile.so

    LoadModule authz_user_module /usr/lib/apache2/modules/mod_authz_user.so

    LoadModule authz_dbm_module /usr/lib/apache2/modules/mod_authz_dbm.so

    LoadModule authz_owner_module /usr/lib/apache2/modules/mod_authz_owner.so

    LoadModule authz_default_module /usr/lib/apache2/modules/mod_authz_default.so

    LoadModule auth_basic_module /usr/lib/apache2/modules/mod_auth_basic.so

    LoadModule auth_digest_module /usr/lib/apache2/modules/mod_auth_digest.so

    LoadModule cache_module /usr/lib/apache2/modules/mod_cache.so

    LoadModule mem_cache_module /usr/lib/apache2/modules/mod_mem_cache.so

    LoadModule dbd_module /usr/lib/apache2/modules/mod_dbd.so

    LoadModule dumpio_module /usr/lib/apache2/modules/mod_dumpio.so

    LoadModule ext_filter_module /usr/lib/apache2/modules/mod_ext_filter.so

    LoadModule include_module /usr/lib/apache2/modules/mod_include.so

    LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so

    LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so

     

    Also,  when I try sudo apt-get apache2 php5

     

    I get this:

    E: Invalid operation apache2

  7. Hello,

        I have installed Apache 2.2.4 and php 5.2.4 on my Ubuntu platform and when I do  sudo httpd -k restart

     

    I get this:

     

    httpd: Syntax error on line 66 of /etc/apache2/httpd.conf: API module structure `auth_digest_module' in file /usr/lib/apache2/modules/mod_auth_digest.so is garbled - perhaps this is not an Apache module DSO?

     

    I know I have a php version that's not working w/ my Apache 2.2.4 but I'm not sure about how to find the correct version of PHP that will work w/ this version of Apache.   

     

    Anyone know the best way to resolve this?

     

    Thanks,

    Clem C

  8. Hello,

    I have a Flash application that's sending data from a simple input dynamic text field to a php script that saves it to a database. I then retrieve the data from the database and export it to a csv file. I am having problems w/ the wrapped text from the flash application causing the csv file to display the text in a newline.

    When I try to detect the usual newline characters, (IE. \n, \r, \n\r) I am not finding any in the text.

    here's the line of php code i'm using to try to detect any newline chars:

    [code]
    if(preg_match("#[\n|\r|\r\n][ ]*$#", $row_export['data_dump'] ) ){ echo "Newline characters found!"; }else{ echo "NO NEWLINES OR CARRIAGE RETURNS"; }
    [/code]



    Is there any different newline or wrap characters that I could be testing for?

    Thanks,
    Clem C

  9. Hello,

      I'm trying to create thumbnails w/ the  imagejpeg():  and no matter what directory I try to reference w/ the function and no matter what permissions I give any folder, I still get this error:

    Warning: imagejpeg(): Unable to open '../' for writing in /home/content/e/r/i/eric68/html/admin/catalogue/catalogue_admin.php on line 124


    here's the function I'm using:

    [code]
    function thumb( $filename, $destination, $th_width, $th_height, $forcefill )

          list( $width, $height ) = getimagesize( $filename );
          $source = imagecreatefromjpeg( $filename );

          #$filename = '../../uploaded_gallery_photos/global_album_photos/25_tn_bgfish.jpg';

          if( $width > $th_width || $height > $th_height )
          {
                $a = $th_width/$th_height;
                $b = $width/$height;

        if( ( $a > $b ) ^ $forcefill )
        {
            $src_rect_width  = $a * $height;
            $src_rect_height = $height;
            if(!$forcefill)
            {
              $src_rect_width = $width;
              $th_width = $th_height/$height*$width;
            }
        }
        else
        {
            $src_rect_height = $width/$a;
            $src_rect_width  = $width;
            if(!$forcefill)
            {
              $src_rect_height = $height;
              $th_height = $th_width/$width*$height;
            }
        }

        $src_rect_xoffset = ( $width - $src_rect_width ) / 2*intval( $forcefill );
    $src_rect_yoffset = ( $height - $src_rect_height ) / 2*intval( $forcefill );

        $thumb  = imagecreatetruecolor($th_width, $th_height);
        imagecopyresized( $thumb, $source, 0, 0, $src_rect_xoffset, $src_rect_yoffset, $th_width, $th_height, $src_rect_width, $src_rect_height );

                echo "<br>thumb-->>$thumb || filename-->>$filename || destination-->>$destination";
        #imagejpeg( $thumb, $destination );
                imagejpeg( $thumb, '../', 100 );
      }
    }
    [/code]

    Just don't get it.

    Clem C
  10. PROBLEM SOLVED!

    The problem was that I was trying to grant the security permissions through IIS manager instead of simple old explorer.  I just had to grant the default web viewing (in our case: IUSR_WW251)  group permissions to the folder where the scripts were being read.

    Here's what I did:

    Windows Explorer >> Parent folder where scripts are reading/writing to files >> Sharing and Security >>
    Security tab >> Add >> Advanced >> Find Now >> choose default web user (IUSR_WW251) >> OK >> OK
  11. Ok - got it!!

    Actually mysql and PHP were running fine after I changed the extension_dir to the correct directory.

    The Problem after that was w/ phpMyAdmin and it's configuration.

    Here's what I did to fix that:

    [code]

    'host' from localhost to the machine host name 'extension' to 'mysqli' 'user' to a user who has access to MySQL, i.e. can log onto MySQL on the server 'password' to the password of the user
    [/code]
  12. Yeah there is - and it looks a bit problematic to me:

    [code]
    Active Persistent Links 0
    Active Links 0
    Client API version 4.1.7

    Directive Local Value Master Value
    mysql.allow_persistent On On
    mysql.connect_timeout 60 60
    mysql.default_host no value no value
    mysql.default_password no value no value
    mysql.default_port no value no value
    mysql.default_socket no value no value
    mysql.default_user no value no value
    mysql.max_links Unlimited Unlimited
    mysql.max_persistent Unlimited Unlimited
    mysql.trace_mode Off Off
    [/code]

    Any Suggestions?

  13. Hello,

    This is rather embarassing given my 4 years of php coding experience but I've noticed when I'm pulling quoted text from a database into a input text field, the entire text w/in the quotes, and the quotes themselves disappears.

    For instance, if I try to echo this string: this is "text", only the string: this is will show up in the text input box.

    I know there has to something stupid I'm missing

    Thanks,
    Clem C
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.