Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: PHP script does not work properly

  1. #11
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,079
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: PHP script does not work properly

    Quote Originally Posted by BkkBonanza View Post
    You are getting data now. It shows it above. But if you look at the last bit of code it only outputs the records in the table if the "upstatus" value is 1. But your data all has upstatus = 0. So the reason it's not showing is the data you are getting.

    This line,

    if($mageproducts[$productid]['upstatus']==1)
    {
    ...

    stops any data from showing.
    upstatus does not appear to come from the XML stream. It is metadata used by the script. It is initialised to 0 on line 33, then conditionally set to 1 on line 100.

    It might be worth printing out $errorinfo, i.e.
    Code:
    		if($errorinfo->length==0)
    			$mageproducts[$refid4->nodeValue]['upstatus']=1;
                    else
                            print $errorinfo, "\n";

  2. #12
    Join Date
    May 2006
    Location
    New York
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP script does not work properly

    I will give you the print out of $errorinfo as soon as i can.
    Thanks for helping!

  3. #13
    Join Date
    May 2006
    Location
    New York
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP script does not work properly

    Below is the output (partial):

    <br>init request<br>completed<pre><br>total 0<pre>Array
    (
    [719192184275] => Array
    (
    [sku] => L2000CP-BF
    [qty] => 0
    [upstatus] => 0
    )

    [883609805180] => Array
    (
    [sku] => 4434HE1
    [qty] => 0
    [upstatus] => 0
    )

    [805736023909] => Array
    (
    [sku] => EA221WM-BK
    [qty] => 0
    [upstatus] => 0
    .
    .
    .(more items-same as above)
    .
    <table border=1><tr><td>Sl.No</td><td>SKU</td><td>UPC#</td><td>Current Stock Status</td><td>Magento Stock</td><td>TechData Stock</td><td>Cost</td><td>Magent
    o Price</td><td>TechData Price</td></tr>
    Thanks for helping out!

  4. #14
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: PHP script does not work properly

    It's not too clear from that what the errorinfo output is. Looking at the code I believe it's in the line before the product array. From what I can see it should be printing an errorinfo for each product item but that doesn't appear to be happening.

    I'd suggest to debug further you'd want to add more "markers" in the output so you can see what code is being run or skipped over and how many times. By markers I mean just extra text labels like "ERR:", "HERE" etc.
    Send tips to: 17raXAGM42vZX21Vcb5HDwq2GMLmVwN4qd

  5. #15
    Join Date
    May 2006
    Location
    New York
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP script does not work properly

    thanks for the tip!
    i am very new to coding, how do i place "markers"in this case and where?

    thanks again for helping!

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •