Jump to content

abdelelbouhy

Members
  • Posts

    103
  • Joined

  • Last visited

Posts posted by abdelelbouhy

  1. Hi guys,

    i have two tables products and deleted_products i want to select products_id from the two tables where the field suspend = 1 but there's no relationship between the tables in other words i want all the products_id from the tables where suspend = 1 but the products_id in table one doesn't match produtcs_id in table 2 the only relationship i can find is the suspend in both tables is 1

     

     

    my query string is like that

     

    select p.products_id as PID, dp.products_id AS PDID FROM products p, deleted_products dp WHERE p.suspend = dp.suspend and p.suspend = 1

     

    it return zero result but the two tables have products with suspend = 1

     

    thanx

  2. Thank you i was trying to figure it out all day but when i call it the last time with 2 parameters var old should have the previous one the one with 1 parameter instead of the one with no parameter because the object property has the same name find it should be overwritten i know you said it queued up all but how is that if the property name is the same

  3. Thank you very much now start to clear it a bit one more thing how the arguments inside the clouser refer to the function that is passed as the argument to the outer function shouldn't arguments inside the inner refer to the arguments of the inner function

  4. Hi guys,

    can you please explain how this code is working i'm a bit confuse about the fn.length == arguments.length here the code

     

    function addMethod(object, name, fn) {
    var old = object[name];
    object[name] = function(){
    if (fn.length == arguments.length){ //this line i don't understand how it works
    return fn.apply(this, arguments)
    }else if (typeof old == 'function'){
    return old.apply(this, arguments);
    }
    };
    }
    var ninjas = {
    values: ["Dean Edwards", "Sam Stephenson", "Alex Russell"]
    };
    addMethod(ninjas, "find", function(){
    return this.values;
    });
    addMethod(ninjas, "find", function(name){
    var ret = [];
    for (var i = 0; i < this.values.length; i++)
    if (this.values.indexOf(name) == 0)
    ret.push(this.values);
    return ret;
    });
    addMethod(ninjas, "find", function(first, last){
    var ret = [];
    for (var i = 0; i < this.values.length; i++)
    if (this.values == (first + " " + last))
    ret.push(this.values);
    return ret;
    });
    when you call addMethod the first time fn.length == arguments.length is true both are zero that's fine then it execute return fn.apply(this, arguments)
    the second and third fn.length is 1 then 2 but arguments.length is 0 because no args passed to the anonymous function and it should execute return old.apply(this, arguments); but what happened it execute the first condition so how comes it execute this line even if the lengths are not equal
  5. many thanks is there is anyway in php let me download more than a file in one http request the problem is after i create the five files i need to download them all together that why i'm trying to zip them

  6. hi guys i'm having a problem zipping files to folder what is happing the script zip the folder and add some files to that folder then it download the folder but when i unzip the folder i find empty files with 0 KB but when i download via FTP( the unzipped files) contain content any idea the code is like that $zip = new ZipArchive; generate the filegenerateAmazonSkuCSV($arra_sku_uk,$csvsavefilepath,'cb_uk');$csvdowloadfilepath = 'files/csv/amazoninventorysku/';$file_type = 'application/csv';$file_name = "cb_uk_amazon_stock.csv";$file = DIR_FS_ADMIN.$csvdowloadfilepath . $file_name;if ($zip->open(DIR_FS_ADMIN.$csvdowloadfilepath .'changingbag_skus.zip', ZIPARCHIVE::CREATE) != TRUE) {die ("Could not open archive");}$zip->addFile($csvsavefilepath,$file_name);$zip->addFile($csvsavefilepath,$another_file);$zip->close();then download the file $file_found = downloadAmazonSkuFile( $file, $file_name, $file_type ); the function for downloadfunction downloadAmazonSkuFile( $file, $file_name, $file_type ){ if( ! is_file( $file ) ){return false; } $filesize = filesize( $file ); header('Content-Description: File Transfer');header('Content-Type: application/octet-stream');header('Content-Disposition: attachment; filename='.basename($file));header('Content-Transfer-Encoding: binary');header('Expires: 0');header('Cache-Control: must-revalidate, post-check=0, pre-check=0');header('Pragma: public');header('Content-Length: ' . filesize($file));ob_clean();flush();readfile($file); return true; }#func many thanks

  7. hello guysi just start with cgi in perl and i'm running iis7.0 i followed all the steps to configure the iis7.0 to work with cgi but when i write the full path in the browserit come out with alert to save or run the file it doesn't execute it and i did allow the execution restriction as i followed that steps i don't know what is wrongit's the iis configuration or maybe the file name extension (.pl) could be the cgi files use different file name extensionplease help

×
×
  • Create New...