php-windows Digest 17 Jul 2004 21:06:25 -0000 Issue 2323

Topics (messages 24197 through 24203):

Re: PHP and RedBack COM objects
        24197 by: Brian E
        24200 by: Jason Barnett

[mysql]
        24198 by: Ciprian Constantinescu
        24199 by: Jason Barnett
        24201 by: Ciprian Constantinescu
        24202 by: php_beginner

Re: PHP5 questions
        24203 by: Jeff Hill

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Please note.. some debugging code does exist. Also the server maybe just misconfigured... it comes with no documentation of where to put the .ini file that pairs with the COM object.

Here you go:

<?
//Response.Expires = 0
ini_set("max_execution_time","0");
error_reporting(0);
//' This function demonstrates how to extract values from a multivalued field
function ExtractMultiValues($redField)
{
$strValue = "";
echo $redFiled->Count . " ";
if ($redField->Count > 1){
for($count=1;$count <= $redField->Count;$count++)
{
if (strlen(trim($strValue)) > 0)
$strValue = $strValue . $redField->Value($count-1) . "<br>";
else
$strValue = $redField->Value($count-1) . "<br>";
}
}
else
$strValue = $redField->Value(0);
return $strValue;
}


$oInv = new COM("RedBack.RedObject");
//error_log("Created RedObject\n",3,"d:/php/phpdebug.txt");
$rField = new COM("RedBack.RedField");
//error_log("Created RedField\n",3,"d:/php/phpdebug.txt");
$oInv->Open2("summit", "SBO:GetAllInventory");
//error_log("Opened Summit\n",3,"d:/php/phpdebug.txt");
$oInv->callMethod("GetAllInv_RB");
//error_log("Called GetAllInv_RB\n",3,"d:/php/phpdebug.txt");
?>
<html>
<head>
<title>Test Get All Inventory</title>
</head>
<body>
<form action="" method="post">
<INPUT TYPE="submit" name="logoff" onClick="this.form.action='./GetAllInventory.asp';" VALUE="Select">
<?
//' Now we set the value to a RedField and convert the VMs and SVMs to something the eye can understand
$rField->StringValue = $oInv->internalInventoryIDs;
$strInternalInvIDs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->externalInventoryIDs;
//$strExternalInvIDs = ExtractMultiValues($rField);
$strExternalInvIDs = $rField->Value(0);
print_r(get_object_vars($oInv));
$rField->StringValue = $oInv->descriptions;
$strDescriptions = ExtractMultiValues($rField);
$rField->StringValue = $oInv->typeCodes;
$strTypeCodes = ExtractMultiValues($rField);
$rField->StringValue = $oInv->priceTypes;
$strPriceTypes = ExtractMultiValues($rField);
$rField->StringValue = $oInv->beginningEffectiveDates;
$strBegEffectiveDates = ExtractMultiValues($rField);
$rField->StringValue = $oInv->endingEffectiveDates;
$strEndEffectiveDates = ExtractMultiValues($rField);
$rField->StringValue = $oInv->prices;
$strPrices = ExtractMultiValues($rField);
$rField->StringValue = $oInv->qualifyingVolumes;
$strQualifyingVolumes = ExtractMultiValues($rField);
$rField->StringValue = $oInv->commissionableVolumes;
$strCommissionableVolumes = ExtractMultiValues($rField);
$rField->StringValue = $oInv->taxBases;
$strTaxBases = ExtractMultiValues($rField);
$rField->StringValue = $oInv->vatTaxInclFlgs;
$strVatTaxInclFlgs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->redemptionValues;
$strRedemptionValues = ExtractMultiValues($rField);
$rField->StringValue = $oInv->maxQuantities;
$strMaxQuantities = ExtractMultiValues($rField);
$rField->StringValue = $oInv->suggestedRetailPrices;
$strSuggestedRetailPrices = ExtractMultiValues($rField);
$rField->StringValue = $oInv->vatTaxRetailInclFlgs;
$strVatTaxRetailInclFlgs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->countries;
$strCountries = ExtractMultiValues($rField);
$rField->StringValue = $oInv->shipWeights;
$strShipWeights = ExtractMultiValues($rField);
$rField->StringValue = $oInv->methodsOfMeasure;
$strMethodsOfMeasure = ExtractMultiValues($rField);
$rField->StringValue = $oInv->unitsPerCase;
$strUnitsPerCase = ExtractMultiValues($rField);
$rField->StringValue = $oInv->singleUnitInternalIDs;
$strSingleUnitInternalIDs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->singleUnitExternalIDs;
$strSingleUnitExternalIDs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->singleUnitDescs;
$strSingleUnitDescs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->componentInternalIDs;
$strComponentInteralIDs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->componentExternalIDs;
$strComponentExternalIDs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->componentDescriptions;
$strComponentDescriptions = ExtractMultiValues($rField);
$rField->StringValue = $oInv->componentQuantities;
$strComponentQuantities = ExtractMultiValues($rField);
$rField->StringValue = $oInv->warrantyMonths;
$strWarrantyMonths = ExtractMultiValues($rField);
$rField->StringValue = $oInv->alternateInventoryIDs;
$strAlternateInventoryIDs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->descriptionLongs;
$strDescriptionLongs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->personalizationPromptIDs;
$strPersonalizationPromptIDs = ExtractMultiValues($rField);
$rField->StringValue = $oInv->personalizationPrompts;
$strPersonalizationPrompts = ExtractMultiValues($rField);
$rField->StringValue = $oInv->personalizationPromptMessages;
$strPersonalizationPromptMessages = ExtractMultiValues($rField);
$rField->StringValue = $oInv->personalizationPromptValueTypes;
$strPersonalizationPromptValueTypes = ExtractMultiValues($rField);
$rField->StringValue = $oInv->personalizationPromptTextLength;
$strPersonalizationPromptTextLength = ExtractMultiValues($rField);
$rField->StringValue = $oInv->personalizationPromptMandatoryFlgs;
$strPersonalizationPromptMandatoryFlgs = ExtractMultiValues($rField);
?>
<table border="1">
<tr><td colspan=6 align=center><a href='./index.html'>Back to Index</a></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Internal Inventory IDs:</td><td align=left valign="top"><?= $strInternalInvIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">External Inventory ID:</td><td align=left valign="top"><?=$strExternalInvIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Descrptions:</td><td align=left valign="top"><?= $strDescriptions;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Type Codes:</td><td align=left valign="top"><?= $strTypeCodes;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Price Types:</td><td align=left valign="top"><?= $strPriceTypes;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Beginning Effective Dates:</td><td align=left valign="top"><?= $strBegEffectiveDates;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Ending Effective Dates:</td><td align=left valign="top"><?= $strEndEffectiveDates;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Prices:</td><td align=left valign="top"><?= $strPrices;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Qualifying Volume:</td><td align=left valign="top"><?= $strQualifyingVolumes;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Commissionable Volume:</td><td align=left valign="top"><?= $strCommissionableVolumes;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Tax Bases:</td><td align=left valign="top"><?= $strTaxBases?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Vat Tax Inclusion Flags:</td><td align=left valign="top"><?= $strVatTaxInclFlgs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Redemption Values:</td><td align=left valign="top"><?= $strRedemptionValues;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Maximum Quantities Allowed:</td><td align=left valign="top"><?= $strMaxQuantities;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Suggested Retail Price:</td><td align=left valign="top"><?= $strSuggestedRetailPrices;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Vat tax Retail Inclusion Flags:</td><td align=left valign="top"><?= $strVatTaxRetailInclFlgs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Countries:</td><td align=left valign="top"><?= $strCountries;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Shipping Weights:</td><td align=left valign="top"><?= $strShipWeights;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Methods of Weight Measure:</td><td align=left valign="top"><?= $strMethodsOfMeasure;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Units per Case:</td><td align=left valign="top"><?= $strUnitsPerCase;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Single Unit Internal IDs:</td><td align=left valign="top"><?= $strSingleUnitInternalIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Single Unit External IDs:</td><td align=left valign="top"><?= $strSingleUnitExternalIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Single Unit DescriptionsD:</td><td align=left valign="top"><?= $strSingleUnitDescs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Component Internal IDs:</td><td align=left valign="top"><?= $strComponentInteralIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Component External IDs:</td><td align=left valign="top"><?= $strComponentExternalIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Component Descriptions:</td><td align=left valign="top"><?= $strComponentDescriptions;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Component Quantities:</td><td align=left valign="top"><?= $strComponentQuantities;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Warranty Months:</td><td align=left valign="top"><?= $strWarrantyMonths;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Alternate Inventory IDs:</td><td align=left valign="top"><?= $strAlternateInventoryIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Long Descriptions:</td><td align=left valign="top"><?= $strDescriptionLongs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Personalization Prompt IDs:</td><td align=left valign="top"><?= $strPersonalizationPromptIDs;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Personalization Prompts:</td><td align=left valign="top"><?= $strPersonalizationPrompts;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Personalization Prompt Messages:</td><td align=left valign="top"><?= $strPersonalizationPromptMessages;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Personalization Prompt Value Types:</td><td align=left valign="top"><?= $strPersonalizationPromptValueTypes;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Personalization Prompt Text Length:</td><td align=left valign="top"><?= $strPersonalizationPromptTextLength;?></td></tr>
<tr><td width=10>&nbsp;</td><td align=left valign="top">Personalization Prompt Mandatory Flags:</td><td align=left valign="top"><?= $strPersonalizationPromptMandatoryFlgs;?></td></tr>
</table>
</form>
</body>
</html>


Jason Barnett wrote:
Hey Brian, can you just put the code inline?  I didn't get the attachment.



Brian E wrote:

Hello.

I'm trying to access RedBack COM objects (Redback is a garbage DB that one of my clients has purchased) through PHP rather than documented ASP.

I can Create the objects just fine and make the initial Calls to the methods... but when I try to view the String results, I get Object types returning. I am attaching an example code.

Thanks.

Brian

--- End Message ---
--- Begin Message --- I checked it out a bit last night, since I don't own a license for RedBack (no offense :)) I tried checking the online manuals. Didn't see too much that looked useful. AFAIK the objects were supposed to be returning strings for the Value call, but I'm thinking that I somehow missed something and Value is just returning objects instead. Not sure what kind (again, I don't have a library to test) but my best guess is they're VARIANTs.

When you do figure out the answer to your problem, please post it here. There aren't many PHPers that use RedBack, but your solution may really help those in need.


Brian E wrote:

Please note.. some debugging code does exist. Also the server maybe just misconfigured... it comes with no documentation of where to put the .ini file that pairs with the COM object.

Here you go:

<?
//Response.Expires = 0
ini_set("max_execution_time","0");
error_reporting(0);
//' This function demonstrates how to extract values from a multivalued field
function ExtractMultiValues($redField)
{
$strValue = "";
echo $redFiled->Count . " ";

minor typo: echo $redField->Count . " ";

if ($redField->Count > 1){
for($count=1;$count <= $redField->Count;$count++)
{
if (strlen(trim($strValue)) > 0)
$strValue = $strValue . $redField->Value($count-1) .

test Value here and see if it's an object that you get. All of your strings below are sent through this function so this *has* to be the problem.


"<br>";
            else
                $strValue = $redField->Value($count-1) . "<br>";
            }
        }
    else
        $strValue = $redField->Value(0);

it would also be interesting to test this and make sure this gives you what you want as well (string?)


    return $strValue;
}


--- End Message ---
--- Begin Message ---
    Where can I download a working "libmysql.dll" to use on WindowsXP? I
have a version that doesn't work. All I get is "Unable to load dynamic
library 'C:\php\ext\php_mysql.dll' - The specified procedure could not be
found".

    I have that version of libmysql.dll in both the php\ext and
windows\system32 directories.

--- End Message ---
--- Begin Message --- Ciprian Constantinescu wrote:
    Where can I download a working "libmysql.dll" to use on WindowsXP? I
have a version that doesn't work. All I get is "Unable to load dynamic
library 'C:\php\ext\php_mysql.dll' - The specified procedure could not be
found".

Are you trying to use dl() to load the library? It's probably easiest to just uncomment the line in php.ini for mysql.



I have that version of libmysql.dll in both the php\ext and windows\system32 directories.

Strange... I would have thought you needed libmysql in php\ext, but I checked out my configuration (pretty much default 5.0.0) and my libmysql is located in the php directory. Are you using the latest PHP? I had mysql problems with a few of the release candidates.

--- End Message ---
--- Begin Message ---
> Are you trying to use dl() to load the library?  It's probably easiest to
just
> uncomment the line in php.ini for mysql.

No. I just have in php.ini a line with "extension=php_mysql.dll"


> Strange... I would have thought you needed libmysql in php\ext, but I
checked
> out my configuration (pretty much default 5.0.0) and my libmysql is
located in
> the php directory.  Are you using the latest PHP?  I had mysql problems
with a
> few of the release candidates.

I am using the latest version. I have moved the libmysql.dll from php to
php\ext. Now it's working. Thankyou so very much!

--- End Message ---
--- Begin Message ---
I think that you need php_mysql.dll and not libmysql.dll. Probably there are
two dll's. Search for php_mysql.dll in your php directory. If you do not
have I think you should create it compiling the code. It should be located
in c:\php\ext\mysql or something like this. If you have it put in c:\php\ext
(your extension_dir in php.ini)

Cheers,
Mauro

----- Original Message ----- 
From: "Ciprian Constantinescu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 17, 2004 4:20 AM
Subject: [PHP-WIN] [mysql]


>     Where can I download a working "libmysql.dll" to use on WindowsXP? I
> have a version that doesn't work. All I get is "Unable to load dynamic
> library 'C:\php\ext\php_mysql.dll' - The specified procedure could not be
> found".
>
>     I have that version of libmysql.dll in both the php\ext and
> windows\system32 directories.
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Phil,
Here's what I've encountered so far. In all cases I've selected Advanced so
I could see what was being set by default, and to set the SMTP stuff.

* Install.txt still refers to InstallShield, but you're using Wise. Is this
an oversight, or is the distributed copy of Install.txt back-level?

* it appears that "php.ini-dist" is being installed rather than
"php.ini-recommended". Is this by design?

* on my system IIS4+ was initially selected. Does this indicate that it
detected IIS5, or is it just a default value?

* I then selected IIS6 (carelessly, as I have it running on a different
box). Near the end of the install a system dialog was displayed complaining
about missing file C:\WinNT\system32\iisext.vbs. After responding to the
dialog, the install hung and had to be killed via task manager. The Install
log never got created so I could not run the uninstall.

I reran the install and selected IIS4 which completed normally. I next
walked thru the manual steps in Install.txt to check what Install did (or
didn't) do:

- Install.txt recommends setting security on php.ini to give Everyone read
access. Had to do this manually. Should the installer have done it?

- The section on IIS/PWS covers registry settings and mentions a reg file,
"pws-php5cgi.reg". This file was not present in either the installer or the
full zip version.

- the text refers to adding the ScriptMap string value; I assume the
"example" value should refer to "php-cgi.exe" (not "php.exe")? Or, see
next...

- The zip distribution also includes "php-win.exe", which is the same size
as "php.exe". Should the installer actually have used "php-win.exe" and
renamed it to "php.exe"??

- In the discussion of using Internet Services Manager, there are two ways
to get there:

1. If you go in thru the Computer Management MMC, you see Services and
Applications, and within that, Internet Information Services. Here it lists
the "Default Web Site", and the Properties selection in the context menu
takes you directly to the Properties so ou can access the Home Directiry
tab.

2. When you go in via Control Panel, it displays the named server, and after
you click Properties in the context menu you then need to click Master
Properties. From there you can access the Home Directory setting.

I'm not sure whether master Properties is the right way to go; perhaps
Install.txt could clarify this. Also, the Install.txt instructions had us
set the mapping manually manually on the previous page.

- In the next paragraph, the text refers to "Method Exclusions"; my dialog
has "All verbs"

When I got all done I created a test file in a test folder. I consistently
got 404's. I checked the permissions. I checked the folder name. I checked
everything three times. I put a test HTML file in the same folder and it
found that fine. I ran a command lin etest and that worked file. I verified
the php.ini location an settings.

The problem turned out to be the recommended setting for "doc_root" in
Install.txt. It says c:\inetpub, but it should be c:\inetpub\wwwroot. Not
knowing how it was going to be used internally, I didn't spot this at first.

At any rate, I'm up and running in about an hour, not having known squat
about php to start with. Nice job!
Thanks,
...Jeff

"Phil Driscoll" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Friday 16 July 2004 23:44, Jeff Hill wrote:
>
> > Also, are there plans for a windows installer version of php5?
> I have prepared the installer for php5 which is being tested at the
moment.
> You can download a copy from
> http://www.dialsolutions.com/phil/php/php-5.0.0-installer.exe
>
> Let me know if you have any problems with it.
>
> Cheers
> -- 
> Phil Driscoll

--- End Message ---

Reply via email to