Re: [PHP] Algorithm Help
It also depends on the amount of kids, families and stays. If the numbers are low, by hand may be a lot easier and faster Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl 2013/10/2 Tamara Temple tamouse.li...@gmail.com On Oct 1, 2013, at 1:51 PM, Floyd Resler fres...@adex-intl.com wrote: Here's my task: A group of kids is going to be staying with different host families throughout the next 8 months. The number of kids staying with a host family can range from 2 to 10. When deciding which kids should stay together at a host family, the idea is for the system to put together kids who have stayed with each other the least on past weekends. So, if a host family can keep 5 kids, then the group of 5 kids who have stayed together the least will be chosen. I can't think of an easy, quick way to accomplish this. I've tried various approaches that have resulted in a lot of coding and being very slow. My idea was to give each group of kids a score and the lowest score is the group that is selected. However, this approach wound of iterating through several arrays several times which was really slow. Does anyone have any ideas on this puzzle? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php While definitely a tempting coding exercise, I just want to say that if this is urgent in any way, shuffling cards with the kids' names on them by hand might just be faster and less frustrating :) OTOH, if this is something you're going to have to figure out week after week, then a software solution might be handy. This is also not an *easy* problem to solve; there isn't a simple approach to optimizing this sort of thing because you're building a net between all the various kids based on past stays, in addition to the constraints of host family capacity. Thus your previous code attempts might in fact be the end result. Obviously, structuring the data is the key here. I'm thinking of 3 primary models: Kids, Hosts, and Stays. Kids and Hosts seem pretty obvious. Stays is the interesing model, and needs to have joining tables with Kids and Hosts. A Stay will have one Host, and have many Kids and a date. The algorithm then needs to make the graph where it can pull out the number of times any particular kid has stayed with another, looking something like this: Amy: Ben: 10 Jill: 3 Carlos: 7 Chen: 2 Ben: Amy: 10 Jill: 5 Carlos: 8 Chen: 3 Jill: … and so on Then you be able to pull through that graph and find the smallest number of stays for each kid. Not simple, but I hope this helps. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Algorithm Help
Assuming you don't have to be exact, somthing similar to this might work. Assign each kid to a host family randomly for each kid, check how frequently it has been combined with the kids in its assigned family. if it is too close, swap with a different family when all kids in that family are processed, move on to the next family and repeat, excluding the first family for swapping. do the same for all families excluding the previous families. when you have completed all families, do another iteration or two of the whole process. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl 2013/10/1 Floyd Resler fres...@adex-intl.com m 1375 GLENDALE MILFORD RD., CINCINNATI, OH 45215 On Oct 1, 2013, at 3:14 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2013-10-01 at 15:09 -0400, Aziz Saleh wrote: DB or flatfile? I would create a matrix of all kids crossed with every kid. Everytime a kid is put in a home with another kid, ++ that index. When dispatching kids, sort by index ASC. Aziz On Tue, Oct 1, 2013 at 3:01 PM, John Meyer johnme...@pueblocomputing.comwrote: On 10/1/2013 12:51 PM, Floyd Resler wrote: Here's my task: A group of kids is going to be staying with different host families throughout the next 8 months. The number of kids staying with a host family can range from 2 to 10. When deciding which kids should stay together at a host family, the idea is for the system to put together kids who have stayed with each other the least on past weekends. So, if a host family can keep 5 kids, then the group of 5 kids who have stayed together the least will be chosen. I can't think of an easy, quick way to accomplish this. I've tried various approaches that have resulted in a lot of coding and being very slow. My idea was to give each group of kids a score and the lowest score is the group that is selected. However, this approach wound of iterating through several arrays several times which was really slow. Does anyone have any ideas on this puzzle? Thanks! Floyd Whatever solution you're going with will probably involve a relational database of some sort. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This sounds remarkably like homework, which we can't help you with unless you've got a specific problem that you're stuck with. Thanks, Ash http://www.ashleysheridan.co.uk Oh, no, this is definitely not homework! :) Although it certainly seems like a homework question. This is a real world problem. I'm keeping track of which kids stay with which host families in the database. My initial approach was to start with kid 1 and see how many times the other kids have stayed with kid 1. The move on to kid 2, and so it. This gives me a score for pairs of kids. However, if say three kids are staying at a host family, what is the best way to determine which set of three kids have stayed together the least? Thanks! Floyd
Re: [PHP] Output to File Instead of Browser
How can I have the form generated from my script but either saved to a file or the output returned to another script? if you just want to output the generated output of the script to a file you can use output buffering http://www.php.net/manual/en/book.outcontrol.php HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/8/20 Bastien phps...@gmail.com On 2013-08-20, at 12:38 PM, Floyd Resler fres...@adex-intl.com wrote: I have a php file that generates a form. Of course, this displays in the browser. How can I have the form generated from my script but either saved to a file or the output returned to another script? Thanks! Floyd I guess it depends on how your code is structured. I have older coder where the HTML is all one string so a file_put_contents($html, $filename); works simply. Bastien Koert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and Powershell
Hi, Thanks for your change. I understand what has happend, from MSDN forums http://social.technet.microsoft.com/Forums/windowsserver/en-US/4b841530-9d8c-4d09-a77c-b89c6e0bafab/how-do-i-capture-data-from-invokecommand http://technet.microsoft.com/en-us/library/jj612804.aspx describes that Get-IscsiServerTarget returns an instance of Microsoft.Iscsi.Target.Commands.IscsiServerTarget. De output also includes the runspaceid and pscomputername. Invoke-Command also returns a runspaceid (when executed with -computername). You need to use Select-Object to output only the relevant fields instead. HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/7/19 Alan Loos alan.l...@genco.com Serge, I have, the script itself allows for easy transition into a .ps1, what I have done is removed the # from the debug section to get the full command that is then easily ‘copy and paste’-able into a Powershell prompt and I get the same response in Powershell directly. Also in response to the lastest post to the thread I will snip off some content here. (Sorry first time at this) The ultimate goal is to pull the two variables so I can pass them forward via a PHP script to a MySQL Database. (ie iqn.2013-04.com.widget:Target1 and NotConnected in this case) I believe that the command in Powershell is trying to gather the $Status on both the Invoke-Command and Get-iSCSIServerTarget commands. Which is why I am getting a table in the Powershell Console and browser. Per your request I have rewritten the scripts: (Included inline) TestGetServerTarget.php -- ?php ### ## Variables ## ### $psCMD = powershell.exe -ExecutionPolicy Unrestricted; $psFILE = C:\\Arc\\scripts\\TestGetTarget.ps1; $runCMD = $psCMD. .$psFILE; ## Variable Checking (For Debug Mode) ## #echo \$psCMD = $psCMD; ## Run Script ## exec($runCMD, $out); ## Output ## echo ('pre'); print_r($out); echo ('/pre'); ### ## End Of Script ## ### echo End Of Scene; ? -- TestGetTarget.ps1 -- ### ## Variables ## ### $cred = New-Object System.Management.Automation.PSCredential -ArgumentList @('administra...@widget.com',(ConvertTo-SecureString -String 'MyPassword' -AsPlainText -Force)) $command = Invoke-Command -computername localhost -credential $cred -scriptblock { Get-IscsiServerTarget -TargetName Target1 | % { $_.TargetIqn, $_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck) # ## Execute Scriptblock ## # $command -- Powershell output of TestGetTarget.ps1: -- PS C:\Arc\Scripts .\TestGetTarget.ps1 iqn.2013-04.com.widget:Target1 PSComputerName RunspaceId Value -- -- - localhost f3c5063a-85df-49a3-a5ed-7df04a930684NotConnected -- PHP output webbrowser (Much in the same): -- Array ( [0] = iqn.2013-04.com.widget:Target1 [1] = [2] = PSComputerName RunspaceId Value [3] = -- -- - [4] = localhost f46c9f15-70b4-496c-a9d6... NotConnected [5] = [6] = ) End Of Scene -- *Alan Loos* CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) contain confidential information that is privileged and intended only for the addressee(s) hereof. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or the accompanying attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by return e-mail. *From:* Serge Fonville [mailto:serge.fonvi...@gmail.com] *Sent:* Friday, July 19, 2013 12:16 PM *To:* Alan Loos *Cc:* php-general@lists.php.net *Subject:* Re: [PHP] PHP and Powershell Thank you for your clarification. Have you considered placing the whole powershell -command parameter in a .ps1 script and executing that instead? The benefit would be that it is easier to read and test accordingly. HTH Kind regards/met vriendelijke groet
Re: [PHP] PHP and Powershell
Hi, Although this is more powershell related than PHP... When Powershell returns an object, you can pipe the output through Select-Object to get only certain object properties. To better answer your question: First, why do you specify ComputerName as 127.0.0.1 if the credential is already specified? Also, perhaps it is easier to create a .ps1 file that you run, especially for readability. HTH Wh Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/7/18 Alan Loos alan.l...@genco.com Good morning everyone, First time posting in here, although I've been listening in for a few weeks now. So this one has got me stumped, I am fairly new to PHP but I cannot seem to Google through this one. I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which is ultimately what I'm struggling with. Please see below for script snips and explanations. Also if there are any best practices you would recommend I'm open to it being that I am fairly new and self-taught to PHP scripting. I have a bit of code I've put together (as ugly as it is) as follows in line: ?php ### ## Variables ## ### $TargetName = Target1; $login = \$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @('administra...@widget.com',(ConvertTo-SecureString -String 'MyPassword' -AsPlainText -Force)); $command = Invoke-Command -computername 127.0.0.1 -credential \$cred -scriptblock { Get-IscsiServerTarget -TargetName . $TargetName . | % { \$_.TargetIqn, \$_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck); $psCMD = powershell -ExecutionPolicy Unrestricted -command \$login; $command\ NUL; ## Variable Checking (For Debug Mode) ## #echo \$psCMD = $psCMD; ## Run Script ## exec($psCMD,$out); ## Output ## echo ('pre'); print_r($out); echo ('/pre'); ### ## End Of Script ## ### echo End Of Scene; ? The issue I have is that it feeds back: Array ( [0] = iqn.2013-04.com.widget:Target1 [1] = [2] = PSComputerName RunspaceId Value [3] = -- -- - [4] = 127.0.0.1 52fb8b1b-8d8b-4eec-9419... NotConnected [5] = [6] = ) End Of Scene What I should see so I can then turn it into variables is what I run when I run the command straight through the local Powershell command prompt which would return: PS C:\Users\administrator.WIDGET.000 Get-IscsiServerTarget | % { $_.TargetIqn, $_.Status} iqn.2013-04.com.widget:Target1 NotConnected iqn.2013-04.com.widget:Target2 NotConnected iqn.2013-04.com.widget:Target3 NotConnected iqn.2013-04.com.widget:Target4 Connected iqn.2013-04.com.widget:Target5 NotConnected iqn.2013-04.com.widget:Target6 NotConnected I cannot figure out how to 'exclude' PSComputerName and RunspaceId Sorry in advance for the wordy explanation. Cheers! Alan Please make note of my new email address: alan.l...@genco.com. CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) contain confidential information that is privileged and intended only for the addressee(s) hereof. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or the accompanying attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by return e-mail.
Re: [PHP] PHP and Powershell
How have you determined that invoke-command requires -computername? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/7/19 Alan Loos alan.l...@genco.com Thank you for your response Serge! The computer name is for the invoke-command, ComputerName has to be specified to tell the computer where the command is to be routed. Since I want this to run locally over PHP I figured that it would be a good way to avoid running a script as I have read online that when it can be avoided it’s a good practice (I also couldn’t get this to work properly… J But that is a side note). The piece that outputs the extra RunSpaceID and the PSComputerName is the $_.Status portion of everything. ** ** If someone knows how to cut it out that would be fine but really I just need to pull the Target Name and the Value from result. For the attached example it would be $IQNTarget = iqn.2013-04.com.widget:Target1 and $Value = NotConnected (Which there are two options for this which is Connected or NotConnected). ** ** To use Select Object here would I do Select-Object $Value? ** ** *Alan Loos* | *Flash Anywhere Project* T 925-640-2977 | alan.l...@genco.com ** ** CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) contain confidential information that is privileged and intended only for the addressee(s) hereof. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or the accompanying attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by return e-mail. ** ** *From:* Serge Fonville [mailto:serge.fonvi...@gmail.com] *Sent:* Friday, July 19, 2013 3:05 AM *To:* Alan Loos *Cc:* php-general@lists.php.net *Subject:* Re: [PHP] PHP and Powershell ** ** Hi, Although this is more powershell related than PHP... When Powershell returns an object, you can pipe the output through Select-Object to get only certain object properties. To better answer your question: First, why do you specify ComputerName as 127.0.0.1 if the credential is already specified? Also, perhaps it is easier to create a .ps1 file that you run, especially for readability. HTH Wh Kind regards/met vriendelijke groet, ** ** Serge Fonville ** ** http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table ** ** 2013/7/18 Alan Loos alan.l...@genco.com Good morning everyone, First time posting in here, although I've been listening in for a few weeks now. So this one has got me stumped, I am fairly new to PHP but I cannot seem to Google through this one. I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which is ultimately what I'm struggling with. Please see below for script snips and explanations. Also if there are any best practices you would recommend I'm open to it being that I am fairly new and self-taught to PHP scripting. I have a bit of code I've put together (as ugly as it is) as follows in line: ?php ### ## Variables ## ### $TargetName = Target1; $login = \$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @('administra...@widget.com',(ConvertTo-SecureString -String 'MyPassword' -AsPlainText -Force)); $command = Invoke-Command -computername 127.0.0.1 -credential \$cred -scriptblock { Get-IscsiServerTarget -TargetName . $TargetName . | % { \$_.TargetIqn, \$_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck); $psCMD = powershell -ExecutionPolicy Unrestricted -command \$login; $command\ NUL; ## Variable Checking (For Debug Mode) ## #echo \$psCMD = $psCMD; ## Run Script ## exec($psCMD,$out); ## Output ## echo ('pre'); print_r($out); echo ('/pre'); ### ## End Of Script ## ### echo End Of Scene; ? The issue I have is that it feeds back: Array ( [0] = iqn.2013-04.com.widget:Target1 [1] = [2] = PSComputerName RunspaceId Value [3] = -- -- - [4] = 127.0.0.1 52fb8b1b-8d8b-4eec-9419... NotConnected [5] = [6] = ) End Of Scene What I should see so I can then turn it into variables is what I run when I run the command straight through the local
Re: [PHP] PHP and Powershell
Thank you for your clarification. Have you considered placing the whole powershell -command parameter in a .ps1 script and executing that instead? The benefit would be that it is easier to read and test accordingly. HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/7/19 Alan Loos alan.l...@genco.com According to Technet it is not required ( http://technet.microsoft.com/en-us/library/hh849719.aspx) as the default would be ‘localhost’ which is the same as 127.0.0.1. ** ** So you are correct it is not required. However when I take away ‘-computername 127.0.0.1’ I get a return of: Array ( [0] = Invoke-Command : Parameter set cannot be resolved using the specified named [1] = parameters. [2] = At line:1 char:172 [3] = + $cred = New-Object System.Management.Automation.PSCredential -ArgumentList [4] = @('ad ... [5] = + ~ [6] = ~~~ [7] = + CategoryInfo : InvalidArgument: (:) [Invoke-Command], Parameter [8] =BindingException [9] = + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Comma [10] =nds.InvokeCommandCommand [11] = ) ** ** End Of Scene ** ** For whatever reason, the powershell command does not want to execute properly without that variable being defined explicitly. ** ** (Not sure if that is what you are asking exactly but I think that was answering the question, if not let me know and I’ll try to answer the best I can) ** ** Thanks in advance! ** ** *Alan Loos* ** ** CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) contain confidential information that is privileged and intended only for the addressee(s) hereof. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or the accompanying attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by return e-mail. ** ** *From:* Serge Fonville [mailto:serge.fonvi...@gmail.com] *Sent:* Friday, July 19, 2013 11:13 AM *To:* Alan Loos *Cc:* php-general@lists.php.net *Subject:* Re: [PHP] PHP and Powershell ** ** How have you determined that invoke-command requires -computername? Kind regards/met vriendelijke groet, ** ** Serge Fonville ** ** http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table ** ** 2013/7/19 Alan Loos alan.l...@genco.com Thank you for your response Serge! The computer name is for the invoke-command, ComputerName has to be specified to tell the computer where the command is to be routed. Since I want this to run locally over PHP I figured that it would be a good way to avoid running a script as I have read online that when it can be avoided it’s a good practice (I also couldn’t get this to work properly… J But that is a side note). The piece that outputs the extra RunSpaceID and the PSComputerName is the $_.Status portion of everything. If someone knows how to cut it out that would be fine but really I just need to pull the Target Name and the Value from result. For the attached example it would be $IQNTarget = iqn.2013-04.com.widget:Target1 and $Value = NotConnected (Which there are two options for this which is Connected or NotConnected). To use Select Object here would I do Select-Object $Value? *Alan Loos* CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) contain confidential information that is privileged and intended only for the addressee(s) hereof. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or the accompanying attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by return e-mail. *From:* Serge Fonville [mailto:serge.fonvi...@gmail.com] *Sent:* Friday, July 19, 2013 3:05 AM *To:* Alan Loos *Cc:* php-general@lists.php.net *Subject:* Re: [PHP] PHP and Powershell Hi, Although this is more powershell related than PHP... When Powershell returns an object, you can pipe the output through Select-Object to get only certain object properties. To better answer your question: First, why do you specify ComputerName as 127.0.0.1
Re: [PHP] Hmm remarkable things?
Hi, name=varenr[] size=3 seems to be missing a closing HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/6/23 Karl-Arne Gjersøyen karlar...@gmail.com Hello again. Thanks for last answere. It works very well but now I have another remarkable things. Perhaps logic but not for me yet.. I have this source code: (In norwegian but I translate my thoughts through it in english.) The problem with this source code is that it work very well if I select one single item and post it. But when select 2 or more items the same amount are filled in all field named stk_pa_lager in the database. // count and increase the amount of tubes. if(isset($_POST['oppdater_antall_stk_rorladning'])){ // Get store $valgt_lager = $_POST['valgt_lager']; // Get serial number (Array input type=number name=varenr[] size=3) $varenr = $_POST['varenr']; // number of items in store $stk_pa_lager = $_POST['stk_pa_lager']; // Create an array (input type=number name=oppdater_antall_stk_rorladning[] size=3) $oppdater_antall_stk_rorladning = $_POST['oppdater_antall_stk_rorladning']; // Extract the array and save it induvidual as items in $rorladning foreach($oppdater_antall_stk_rorladning as $rorladning){ // Multiply and add new items to that one already is in store $oppdatert_antall_stk_rorladning = $stk_pa_lager + $rorladning; // Extract serialnumber and save them one by one in $vnr foreach($varenr as $vnr){ // Connect to MySQL database include('../../tilkobling.php'); // Update table rorladning $sql = UPDATE rorladning SET stk_pa_lager = '$oppdatert_antall_stk_rorladning' WHERE valgt_lager = '$valgt_lager' AND varenr = '$vnr'; mysql_query($sql, $tilkobling) or die(mysql_error()); } // Output the result to screen echo pRoslash;rladning med varenr: b$vnr/b er oppdatert fra b$stk_pa_lager/b til b$oppdatert_antall_stk_rorladning/b paring; lager: b$valgt_lager/b./p; //echo $oppdatert_antall_stk_rorladningbr; unset($rorladning); unset($vnr); } } // My database table: mysql SELECT * FROM rorladning; ++-+---+-+--+-+--+-+ | leverandor | valgt_lager | un_nr | varenavn| varenr | dim_mm | stk_pa_lager | kg_pa_lager | ++-+---+-+--+-+--+-+ | Orica | Tengs | 0081 | Hvit Rør | ETX1.22X1000 | 22x1000 | 70 | 3.7 | | Orica | Tengs | 0081 | Orange Rør | ETX1.17X460 | 17x460 | 70 | 0.95| ++-+---+-+--+-+--+-+ 2 rows in set (0.00 sec) mysql What I think i am doing wrong is the way I write the php/mysql stuff. What I want is to store differt values in stk_pa_lager based on the particular serialnumber. (field varenr). I will be very thankful if you can tell me what is wrong here and point out what to do with it. Thanks for your time. Karl
Re: [PHP] Source code of original PHP release.
Hi, Have you looked at http://php.net/manual/en/history.php.php? Could you also share some information on what you have already, as to prevent we would provide information you already have? HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/23 chris ch...@cribznetwork.com I'm currently writing a paper on the evolution of PHP and web development/security as a whole. One of the things I want to incorporate is snippets of source code to show how things have grown and advanced since the 90's If anyone could help me out I would be much appreciated. All my attempts of trying to find it have turned up nothing :( Cheers, Christopher Tombleson --- Github: https://github.com/chtombleson Blog: http://blog.cribznetwork.com Website: http://cribznetwork.com Ohloh: https://www.ohloh.net/**accounts/chtombleson/https://www.ohloh.net/accounts/chtombleson/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ODBC
Hi, I'm not really clear on what you have and haven't done, but did you check permissions? HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Hi Negin, tnx for advice, now however I have successfully downloaded and installed ODBC and the things needed to connect PHP-ODBC (yum on the same actually) however, the llinked library file that the odbcinit.ini file points to in order to link the libmimodbc.so library is not found, though the file is obviously at that location (apache error_log contains a complaint file not found ) so Im still not through completely /g - Original Message - From: Negin Nickparsa nickpa...@gmail.com To: georg georg.chamb...@telia.com Cc: David OBrien dgobr...@gmail.com; PHP General php-general@lists.php.net Sent: Saturday, May 18, 2013 7:56 PM Subject: Re: [PHP] ODBC do you have the driver in linux? https://www.microsoft.com/en-**us/download/details.aspx?id=**28160https://www.microsoft.com/en-us/download/details.aspx?id=28160 On Tue, May 7, 2013 at 11:46 AM, georg georg.chamb...@telia.com wrote: but isnt there some yum command that will fix things for me (download if necessary, but I actually think the ODBC would be in the distribution of fedora ?) br georg - Original Message - From: David OBrien dgobr...@gmail.com To: georg georg.chamb...@telia.com Cc: PHP General php-general@lists.php.net Sent: Monday, May 06, 2013 11:06 PM Subject: Re: [PHP] ODBC On Mon, May 6, 2013 at 3:32 PM, georg georg.chamb...@telia.com wrote: Hi, Id like to get ODBC connection to SQL from PHP going. Ive done that on XP, but now Im switching to Linux (Fedora). My impression in that the connecting part is per the DB designers responsibility. Im using Mimer-SQL, but cant find any information on how to set up ODBC for that. Any advice welcome. BR georg http://developer.mimer.com/howto/howto_57.htmhttp://developer.mimer.com/**howto/howto_57.htm http://**developer.mimer.com/howto/**howto_57.htmhttp://developer.mimer.com/howto/howto_57.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ODBC
could you su to the user apache runs as (possibly specifying the shell to use) and navigate to the directory? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Hi Serge, compliled some more info Apache error log as: --- [Tue May 14 17:45:11 2013] [error] [client 127.0.0.1] PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/lib/libmimodbc.so' : file not found, SQL state 01000 in SQLConnect in /var/www/html/my2.php on line 19, referer: http://127.0.0.1/ File that is deemed missing: --- [root@this ge]# ls -alF /lib/libmimodbc.so lrwxrwxrwx. 1 root root 39 Apr 29 22:21 /lib/libmimodbc.so - /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so* --- and since this seem to be a link rather than the file (for some reason, think I actually moved lib there--- [root@this ge]# ls -alF /opt total 12 drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ./ dr-xr-xr-x. 18 root root 4096 May 16 19:15 ../ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 MimerSQL-10.0.6J/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/ total 40 drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ./ drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ../ drwxr-xr-x. 2 root root 4096 Dec 21 2011 bin/ drwxr-xr-x. 8 root root 4096 Apr 29 22:20 DbVisualizer/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 doc/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 examples/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 include/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 lib/ drwxr-xr-x. 5 root root 4096 Dec 21 2011 man/ drwxr-xr-x. 2 root root 4096 Apr 29 22:21 misc/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib total 12516 drwxr-xr-x. 2 root root 4096 Dec 21 2011 ./ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ../ -rwxr-xr-x. 1 root root 515740 Dec 20 2011 compat.a* -rwxr-xr-x. 1 root root 1051162 Dec 20 2011 libmimcomm.so* -rwxr-xr-x. 1 root root 1346488 Dec 20 2011 libmimdbi.so* -rwxr-xr-x. 1 root root 5397415 Dec 20 2011 libmimdbs.so* -rwxr-xr-x. 1 root root 1922776 Dec 20 2011 libmimer.so* -rwxr-xr-x. 1 root root 6416 Dec 20 2011 libmimerS.so* -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 libmimodbc.so* -rwxr-xr-x. 1 root root 507386 Dec 20 2011 libqsqlmimer.so* -rwxr-xr-x. 1 root root 136312 Dec 20 2011 mimjdbc3.jar* -rwxr-xr-x. 1 root root 1252 Dec 20 2011 mimsqlxa.o* -rwxr-xr-x. 1 root root 212423 Dec 20 2011 psmdebug.jar* [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 /opt/MimerSQL-10.0.6J/lib/** libmimodbc.so* [root@this ge]# so that seem to be in place ?? -- Tnx Georg - Original Message - From: Serge Fonville To: georg Cc: Negin Nickparsa ; PHP Mailinglist Sent: Sunday, May 19, 2013 12:45 PM Subject: Re: [PHP] ODBC Hi, I'm not really clear on what you have and haven't done, but did you check permissions? HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/**SQLServer/feedback/details/** 417926/truncate-partition-of-**partitioned-tablehttps://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Hi Negin, tnx for advice, now however I have successfully downloaded and installed ODBC and the things needed to connect PHP-ODBC (yum on the same actually) however, the llinked library file that the odbcinit.ini file points to in order to link the libmimodbc.so library is not found, though the file is obviously at that location (apache error_log contains a complaint file not found ) so Im still not through completely /g - Original Message - From: Negin Nickparsa nickpa...@gmail.com To: georg georg.chamb...@telia.com Cc: David OBrien dgobr...@gmail.com; PHP General php-general@lists.php.net Sent: Saturday, May 18, 2013 7:56 PM Subject: Re: [PHP] ODBC do you have the driver in linux? https://www.microsoft.com/en-**us/download/details.aspx?id=**28160https://www.microsoft.com/en-us/download/details.aspx?id=28160 On Tue, May 7, 2013 at 11:46 AM, georg georg.chamb...@telia.com wrote: but isnt there some yum command that will fix things for me (download if necessary, but I actually think the ODBC would be in the distribution of fedora ?) br georg - Original Message - From: David OBrien dgobr...@gmail.com To: georg georg.chamb...@telia.com Cc: PHP General php-general@lists.php.net Sent: Monday, May 06, 2013 11:06 PM Subject: Re: [PHP] ODBC On Mon, May 6, 2013 at 3:32 PM, georg georg.chamb...@telia.com wrote: Hi, Id like to get ODBC connection to SQL from PHP going. Ive done that on XP
Re: [PHP] ODBC
x on directories is required to navigate to a directory. r is needed to read the file Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Staring at it myself; should there be xr in the last position of the access definitions ? (how does Apache process come into the system access wise ?) tnx georg - Original Message - From: georg georg.chamb...@telia.com To: Serge Fonville serge.fonvi...@gmail.com Cc: php-general@lists.php.net Sent: Sunday, May 19, 2013 1:29 PM Subject: Re: [PHP] ODBC Hi Serge, compliled some more info Apache error log as: --- [Tue May 14 17:45:11 2013] [error] [client 127.0.0.1] PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/lib/libmimodbc.so' : file not found, SQL state 01000 in SQLConnect in /var/www/html/my2.php on line 19, referer: http://127.0.0.1/ File that is deemed missing: --- [root@this ge]# ls -alF /lib/libmimodbc.so lrwxrwxrwx. 1 root root 39 Apr 29 22:21 /lib/libmimodbc.so - /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so* --- and since this seem to be a link rather than the file (for some reason, think I actually moved lib there--- [root@this ge]# ls -alF /opt total 12 drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ./ dr-xr-xr-x. 18 root root 4096 May 16 19:15 ../ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 MimerSQL-10.0.6J/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/ total 40 drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ./ drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ../ drwxr-xr-x. 2 root root 4096 Dec 21 2011 bin/ drwxr-xr-x. 8 root root 4096 Apr 29 22:20 DbVisualizer/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 doc/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 examples/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 include/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 lib/ drwxr-xr-x. 5 root root 4096 Dec 21 2011 man/ drwxr-xr-x. 2 root root 4096 Apr 29 22:21 misc/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib total 12516 drwxr-xr-x. 2 root root 4096 Dec 21 2011 ./ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ../ -rwxr-xr-x. 1 root root 515740 Dec 20 2011 compat.a* -rwxr-xr-x. 1 root root 1051162 Dec 20 2011 libmimcomm.so* -rwxr-xr-x. 1 root root 1346488 Dec 20 2011 libmimdbi.so* -rwxr-xr-x. 1 root root 5397415 Dec 20 2011 libmimdbs.so* -rwxr-xr-x. 1 root root 1922776 Dec 20 2011 libmimer.so* -rwxr-xr-x. 1 root root 6416 Dec 20 2011 libmimerS.so* -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 libmimodbc.so* -rwxr-xr-x. 1 root root 507386 Dec 20 2011 libqsqlmimer.so* -rwxr-xr-x. 1 root root 136312 Dec 20 2011 mimjdbc3.jar* -rwxr-xr-x. 1 root root 1252 Dec 20 2011 mimsqlxa.o* -rwxr-xr-x. 1 root root 212423 Dec 20 2011 psmdebug.jar* [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 /opt/MimerSQL-10.0.6J/lib/** libmimodbc.so* [root@this ge]# so that seem to be in place ?? -- Tnx Georg - Original Message - From: Serge Fonville To: georg Cc: Negin Nickparsa ; PHP Mailinglist Sent: Sunday, May 19, 2013 12:45 PM Subject: Re: [PHP] ODBC Hi, I'm not really clear on what you have and haven't done, but did you check permissions? HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/**SQLServer/feedback/details/** 417926/truncate-partition-of-**partitioned-tablehttps://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Hi Negin, tnx for advice, now however I have successfully downloaded and installed ODBC and the things needed to connect PHP-ODBC (yum on the same actually) however, the llinked library file that the odbcinit.ini file points to in order to link the libmimodbc.so library is not found, though the file is obviously at that location (apache error_log contains a complaint file not found ) so Im still not through completely /g - Original Message - From: Negin Nickparsa nickpa...@gmail.com To: georg georg.chamb...@telia.com Cc: David OBrien dgobr...@gmail.com; PHP General php-general@lists.php.net Sent: Saturday, May 18, 2013 7:56 PM Subject: Re: [PHP] ODBC do you have the driver in linux? https://www.microsoft.com/en-**us/download/details.aspx?id=**28160https://www.microsoft.com/en-us/download/details.aspx?id=28160 On Tue, May 7, 2013 at 11:46 AM, georg georg.chamb...@telia.com wrote: but isnt there some yum command that will fix things for me (download if necessary, but I actually think the ODBC would be in the distribution of fedora ?) br georg - Original
Re: [PHP] ODBC
Also, is PHP installed as a module or otherwise? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Serge Fonville serge.fonvi...@gmail.com x on directories is required to navigate to a directory. r is needed to read the file Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Staring at it myself; should there be xr in the last position of the access definitions ? (how does Apache process come into the system access wise ?) tnx georg - Original Message - From: georg georg.chamb...@telia.com To: Serge Fonville serge.fonvi...@gmail.com Cc: php-general@lists.php.net Sent: Sunday, May 19, 2013 1:29 PM Subject: Re: [PHP] ODBC Hi Serge, compliled some more info Apache error log as: --- [Tue May 14 17:45:11 2013] [error] [client 127.0.0.1] PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/lib/libmimodbc.so' : file not found, SQL state 01000 in SQLConnect in /var/www/html/my2.php on line 19, referer: http://127.0.0.1/ File that is deemed missing: --- [root@this ge]# ls -alF /lib/libmimodbc.so lrwxrwxrwx. 1 root root 39 Apr 29 22:21 /lib/libmimodbc.so - /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so* --- and since this seem to be a link rather than the file (for some reason, think I actually moved lib there--- [root@this ge]# ls -alF /opt total 12 drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ./ dr-xr-xr-x. 18 root root 4096 May 16 19:15 ../ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 MimerSQL-10.0.6J/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/ total 40 drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ./ drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ../ drwxr-xr-x. 2 root root 4096 Dec 21 2011 bin/ drwxr-xr-x. 8 root root 4096 Apr 29 22:20 DbVisualizer/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 doc/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 examples/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 include/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 lib/ drwxr-xr-x. 5 root root 4096 Dec 21 2011 man/ drwxr-xr-x. 2 root root 4096 Apr 29 22:21 misc/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib total 12516 drwxr-xr-x. 2 root root 4096 Dec 21 2011 ./ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ../ -rwxr-xr-x. 1 root root 515740 Dec 20 2011 compat.a* -rwxr-xr-x. 1 root root 1051162 Dec 20 2011 libmimcomm.so* -rwxr-xr-x. 1 root root 1346488 Dec 20 2011 libmimdbi.so* -rwxr-xr-x. 1 root root 5397415 Dec 20 2011 libmimdbs.so* -rwxr-xr-x. 1 root root 1922776 Dec 20 2011 libmimer.so* -rwxr-xr-x. 1 root root 6416 Dec 20 2011 libmimerS.so* -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 libmimodbc.so* -rwxr-xr-x. 1 root root 507386 Dec 20 2011 libqsqlmimer.so* -rwxr-xr-x. 1 root root 136312 Dec 20 2011 mimjdbc3.jar* -rwxr-xr-x. 1 root root 1252 Dec 20 2011 mimsqlxa.o* -rwxr-xr-x. 1 root root 212423 Dec 20 2011 psmdebug.jar* [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 /opt/MimerSQL-10.0.6J/lib/** libmimodbc.so* [root@this ge]# so that seem to be in place ?? -- Tnx Georg - Original Message - From: Serge Fonville To: georg Cc: Negin Nickparsa ; PHP Mailinglist Sent: Sunday, May 19, 2013 12:45 PM Subject: Re: [PHP] ODBC Hi, I'm not really clear on what you have and haven't done, but did you check permissions? HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/**SQLServer/feedback/details/** 417926/truncate-partition-of-**partitioned-tablehttps://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Hi Negin, tnx for advice, now however I have successfully downloaded and installed ODBC and the things needed to connect PHP-ODBC (yum on the same actually) however, the llinked library file that the odbcinit.ini file points to in order to link the libmimodbc.so library is not found, though the file is obviously at that location (apache error_log contains a complaint file not found ) so Im still not through completely /g - Original Message - From: Negin Nickparsa nickpa...@gmail.com To: georg georg.chamb...@telia.com Cc: David OBrien dgobr...@gmail.com; PHP General php-general@lists.php.net Sent: Saturday, May 18, 2013 7:56 PM Subject: Re: [PHP] ODBC do you have the driver in linux? https
Re: [PHP] ODBC
And... there is a chance apache doesn't follow the symlink. So you could also try copying the file to that directory instead of symlinking Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Serge Fonville serge.fonvi...@gmail.com Also, is PHP installed as a module or otherwise? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Serge Fonville serge.fonvi...@gmail.com x on directories is required to navigate to a directory. r is needed to read the file Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Staring at it myself; should there be xr in the last position of the access definitions ? (how does Apache process come into the system access wise ?) tnx georg - Original Message - From: georg georg.chamb...@telia.com To: Serge Fonville serge.fonvi...@gmail.com Cc: php-general@lists.php.net Sent: Sunday, May 19, 2013 1:29 PM Subject: Re: [PHP] ODBC Hi Serge, compliled some more info Apache error log as: --- [Tue May 14 17:45:11 2013] [error] [client 127.0.0.1] PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/lib/libmimodbc.so' : file not found, SQL state 01000 in SQLConnect in /var/www/html/my2.php on line 19, referer: http://127.0.0.1/ File that is deemed missing: --- [root@this ge]# ls -alF /lib/libmimodbc.so lrwxrwxrwx. 1 root root 39 Apr 29 22:21 /lib/libmimodbc.so - /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so* --- and since this seem to be a link rather than the file (for some reason, think I actually moved lib there--- [root@this ge]# ls -alF /opt total 12 drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ./ dr-xr-xr-x. 18 root root 4096 May 16 19:15 ../ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 MimerSQL-10.0.6J/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/ total 40 drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ./ drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ../ drwxr-xr-x. 2 root root 4096 Dec 21 2011 bin/ drwxr-xr-x. 8 root root 4096 Apr 29 22:20 DbVisualizer/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 doc/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 examples/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 include/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 lib/ drwxr-xr-x. 5 root root 4096 Dec 21 2011 man/ drwxr-xr-x. 2 root root 4096 Apr 29 22:21 misc/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib total 12516 drwxr-xr-x. 2 root root 4096 Dec 21 2011 ./ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ../ -rwxr-xr-x. 1 root root 515740 Dec 20 2011 compat.a* -rwxr-xr-x. 1 root root 1051162 Dec 20 2011 libmimcomm.so* -rwxr-xr-x. 1 root root 1346488 Dec 20 2011 libmimdbi.so* -rwxr-xr-x. 1 root root 5397415 Dec 20 2011 libmimdbs.so* -rwxr-xr-x. 1 root root 1922776 Dec 20 2011 libmimer.so* -rwxr-xr-x. 1 root root 6416 Dec 20 2011 libmimerS.so* -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 libmimodbc.so* -rwxr-xr-x. 1 root root 507386 Dec 20 2011 libqsqlmimer.so* -rwxr-xr-x. 1 root root 136312 Dec 20 2011 mimjdbc3.jar* -rwxr-xr-x. 1 root root 1252 Dec 20 2011 mimsqlxa.o* -rwxr-xr-x. 1 root root 212423 Dec 20 2011 psmdebug.jar* [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib/**libmimodbc.so -r-xr-xr-x. 1 root root 1693640 Dec 20 2011 /opt/MimerSQL-10.0.6J/lib/* *libmimodbc.so* [root@this ge]# so that seem to be in place ?? -- Tnx Georg - Original Message - From: Serge Fonville To: georg Cc: Negin Nickparsa ; PHP Mailinglist Sent: Sunday, May 19, 2013 12:45 PM Subject: Re: [PHP] ODBC Hi, I'm not really clear on what you have and haven't done, but did you check permissions? HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/**SQLServer/feedback/details/** 417926/truncate-partition-of-**partitioned-tablehttps://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Hi Negin, tnx for advice, now however I have successfully downloaded and installed ODBC and the things needed to connect PHP-ODBC (yum on the same actually) however, the llinked library file that the odbcinit.ini file points to in order to link the libmimodbc.so library is not found
Re: [PHP] ODBC
Hmm, I just noticed GMAIL no longer replies to all, so here is all my correspondence that wasn't sent to the list. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Serge Fonville serge.fonvi...@gmail.com damn, other way around su --shell=/bin/bash - apache Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Serge Fonville serge.fonvi...@gmail.com since your root you can su apache --shell /bin/bash from theron you can do the same tests Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com As I said, Im a bit new to Linux, and the user and access system seem to me a bit . I dont reallly know what user apache runs as, possibly this process status give something ? (seem to be 8 processes, but what the user be apache ? i have accessed php directly, when su root; #php -r 'odbc_connect()'; give only silece, which i interprete that php actually successfully opens the db ? [root@this ge]# ps aux|grep httpd root 1377 0.0 0.7 28900 7804 ? Ss 10:50 0:00 /usr/sbin/httpd -k start apache 1378 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start apache 1379 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start apache 1380 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start apache 1381 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start apache 1382 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start apache 1383 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start apache 1384 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start apache 1385 0.0 0.4 29032 4164 ? S 10:50 0:00 /usr/sbin/httpd -k start root 1387 0.0 0.0 4760 788 pts/0 S+ 10:51 0:00 grep --color=au does this mean that the user is apache ?, and then what would that user have as login password? tnx georg - Original Message - From: Serge Fonville serge.fonvi...@gmail.com To: georg georg.chamb...@telia.com Cc: PHP Mailinglist php-general@lists.php.net Sent: Sunday, May 19, 2013 1:42 PM Subject: Re: [PHP] ODBC could you su to the user apache runs as (possibly specifying the shell to use) and navigate to the directory? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/**SQLServer/feedback/details/** 417926/truncate-partition-of-**partitioned-tablehttps://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 georg georg.chamb...@telia.com Hi Serge, compliled some more info Apache error log as: --- [Tue May 14 17:45:11 2013] [error] [client 127.0.0.1] PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/lib/libmimodbc.so' : file not found, SQL state 01000 in SQLConnect in /var/www/html/my2.php on line 19, referer: http://127.0.0.1/ File that is deemed missing: --- [root@this ge]# ls -alF /lib/libmimodbc.so lrwxrwxrwx. 1 root root 39 Apr 29 22:21 /lib/libmimodbc.so - /opt/MimerSQL-10.0.6J/lib/libmimodbc.so* --- and since this seem to be a link rather than the file (for some reason, think I actually moved lib there--- [root@this ge]# ls -alF /opt total 12 drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ./ dr-xr-xr-x. 18 root root 4096 May 16 19:15 ../ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 MimerSQL-10.0.6J/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/ total 40 drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ./ drwxr-xr-x. 3 root root 4096 Apr 29 22:20 ../ drwxr-xr-x. 2 root root 4096 Dec 21 2011 bin/ drwxr-xr-x. 8 root root 4096 Apr 29 22:20 DbVisualizer/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 doc/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 examples/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 include/ drwxr-xr-x. 2 root root 4096 Dec 21 2011 lib/ drwxr-xr-x. 5 root root 4096 Dec 21 2011 man/ drwxr-xr-x. 2 root root 4096 Apr 29 22:21 misc/ [root@this ge]# ls -alF /opt/MimerSQL-10.0.6J/lib total 12516 drwxr-xr-x. 2 root root 4096 Dec 21 2011 ./ drwxr-xr-x. 10 root root 4096 Apr 29 22:20 ../ -rwxr-xr-x. 1 root root 515740 Dec 20 2011 compat.a* -rwxr-xr-x. 1 root root 1051162 Dec 20 2011 libmimcomm.so* -rwxr-xr-x. 1 root root 1346488 Dec 20 2011 libmimdbi.so* -rwxr-xr-x. 1 root root 5397415
Re: [PHP] ODBC
better would be to allow apache acces to the module i.e. http://www.webhostingtalk.com/showthread.php?t=711418 Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Larry Martell la...@software-horizons.com On Sun, May 19, 2013 at 9:06 AM, georg georg.chamb...@telia.com wrote: Actually who the heck has put SELinux in my machine ? anyone knows (is this a part of fedora ?) Never used Fedora, but it's part of Red Hat and Centos, so would guess it's also part of fedora. You can disable SELinux with this: echo 0 /selinux/enforce
Re: [PHP] ODBC
Again to the list Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Serge Fonville serge.fonvi...@gmail.com better would be to allow apache acces to the module i.e. http://www.webhostingtalk.com/showthread.php?t=711418 Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/19 Larry Martell la...@software-horizons.com On Sun, May 19, 2013 at 9:06 AM, georg georg.chamb...@telia.com wrote: Actually who the heck has put SELinux in my machine ? anyone knows (is this a part of fedora ?) Never used Fedora, but it's part of Red Hat and Centos, so would guess it's also part of fedora. You can disable SELinux with this: echo 0 /selinux/enforce
Re: [PHP] undef func
Assuming OP is using a distro that uses yum for package management; A yum whatprovides pecl should provide the package name that needs to be installed, in case of an apt based distro, this could be done through aptitude. Either way, it seems what might provide more information is details like the commands executed, the distro used and the errors received HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/5/10 georg georg.chamb...@telia.com noop, didnt take, no such package, was my reward /georg - Original Message - From: Gabriel Ricci To: georg Cc: Daniel Brown ; tamouse mailing lists ; PHP General Sent: Friday, May 10, 2013 11:06 PM Subject: Re: [PHP] undef func To have pecl, you need to install PEAR first, yum install php-pear (or yum install php5-pear) should work. Then you can try pecl install pdo_odbc. Att. Gabriel Ricci Website Follow @gabrielricci Facebook profile, GitHub profile On Fri, May 10, 2013 at 6:03 PM, georg georg.chamb...@telia.com wrote: unfortunately that didnt take, pecl is undefined command (my linux is not so strong) trying yum renders no such package - Original Message - From: Daniel Brown danbr...@php.net To: tamouse mailing lists tamouse.li...@gmail.com Cc: georg georg.chamb...@telia.com; PHP General php-general@lists.php.net Sent: Friday, May 10, 2013 9:21 PM Subject: Re: [PHP] undef func On Fri, May 10, 2013 at 3:18 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: Aren't DLLs a Windows thing? Yeah, I misread the bit about MS XP and thought he was using XP for this install. I just realized the remainder of the discussion between us was off-list, so - for posterity - my response, when finding out it is indeed a Linux box, is: pecl install pdo_odbc. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined index....
Hi, Two questions: Where is $xml defined and where is $pos defined? HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/3/15 Jay Blanchard jay.blanch...@sigmaphinothing.org I have inherited a mess of a home-grown PHP framework that literally fills the error_log with 100's of thousands of messages each day. First order of business was rotating the logs, now we are working through each error to solve them. This is a fairly basic error, but I for the life of me cannot remember what the solution is. I have a recursive function that reads from XML files and replaces xi: include directives. It looks like this - function includeXML($file, $locale, $url, $level = 1) { // stuff while(($line = fgets($fp)) !== false) { if($pos === false) { $xml .= $line; } else { includeXML('repository/' . $included, $locale, (int)$level + $pos - 1); } } } Why do I get the notice that $xml is an undefined index? I do not want to suppress the notice, I just want to take care of it properly. I attempted setting $xml within the function but then the whole function fails for some reason in the depths of this hideous framework. Can anyone provide any insight? TVMIA! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined index....
So basically, $xml is out of scope for this function and you are appending to a nonexisting variable? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/3/15 Jay Blanchard jay.blanch...@sigmaphinothing.org [snip] Two questions: Where is $xml defined and where is $pos defined? [/snip] $xml is defined in other functions, just not in this function. $pos is irrelevant to the question - it is just the string position within the file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finding an Address
HI, It seems like you want something according to the following you know your start long/lat you can determine the long/lat arround it for every of those you determine the route. if you follow that route you know the house you find otherwise you can use an increasing circle and if it finds an address on the location, you may be able to determine which of the points in the circles (which increase in size) is closest. Does that match what you want? If not, could you further elaborate what you want exactly? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/28 Floyd Resler fres...@adex-intl.com On Feb 28, 2013, at 1:04 PM, kenrb...@rbnsn.com wrote: On 28.02.2013 12:36, Floyd Resler wrote: I have a project where my client would like to find the nearest street address from where he current is. Getting the longitude and latitude is easy enough but I'm having a hard time finding out how to get the nearest house. I have found a lot of solutions for addresses maintained in a database but these addresses won't be in a database. I thought about just querying Google for each longitude and latitude within in a small circle but my math skills are nowhere near good enough to accomplish that. Anyone have any ideas? Thanks! Floyd Have you tried Google Maps reverse geocoding? https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding Ken That's what I'm doing but I need to find the closest say five houses to the current latitude and longitude coordinates. Thanks! Floyd
Re: [PHP] Finding an Address
well, not exactly. But I can help you (so can others) to go through code flow (it will probably be tedious) you have a position you start and a certain distance from that point (in a circle) From thereon you substract start(x,y) from dest(x,y) by substracting x from x and y from y the diffence is the amount of degrees between the two points are apart, if you add instead you determine a point. so for example you are currently at long: 75, lat: 31 and you want to know some point 6.9 miles away. you start by adding 0 to 75 and 0.1 to 31 you then have one point (both are degrees and one degree is roughly 69 miles) you can also do the opposite, add 0.1 to 75 and 0 to 31, you can also add 0.05 to both (again totaling 0.1), mind though the values that total 0.1 are absolute, even though the long/lat may be negative. The point is that the values added are combined the distance you want to measure against. From thereon you can determine if there is an address at the location (using reverse geo-coding). when increasing the number you add, you measure further and further you'll have to do that all arround the point you started from more information about how long/lat works: http://www.nationalatlas.gov/articles/mapping/a_latlong.html HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/28 Floyd Resler fres...@adex-intl.com Serge, That is precisely what I want! Any ideas on how to accomplish that? Thanks! Floyd On Feb 28, 2013, at 2:52 PM, Serge Fonville serge.fonvi...@gmail.com wrote: HI, It seems like you want something according to the following you know your start long/lat you can determine the long/lat arround it for every of those you determine the route. if you follow that route you know the house you find otherwise you can use an increasing circle and if it finds an address on the location, you may be able to determine which of the points in the circles (which increase in size) is closest. Does that match what you want? If not, could you further elaborate what you want exactly? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/28 Floyd Resler fres...@adex-intl.com On Feb 28, 2013, at 1:04 PM, kenrb...@rbnsn.com wrote: On 28.02.2013 12:36, Floyd Resler wrote: I have a project where my client would like to find the nearest street address from where he current is. Getting the longitude and latitude is easy enough but I'm having a hard time finding out how to get the nearest house. I have found a lot of solutions for addresses maintained in a database but these addresses won't be in a database. I thought about just querying Google for each longitude and latitude within in a small circle but my math skills are nowhere near good enough to accomplish that. Anyone have any ideas? Thanks! Floyd Have you tried Google Maps reverse geocoding? https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding Ken That's what I'm doing but I need to find the closest say five houses to the current latitude and longitude coordinates. Thanks! Floyd
Re: [PHP] Finding an Address
You are right, there is more to it. The incentive from me was to not further complicate a problem that by itself can be very hard to solve. but still, a more accurate measure van only determined by including these concepts. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/28 Sean Greenslade zootboys...@gmail.com On Thu, Feb 28, 2013 at 3:18 PM, Serge Fonville serge.fonvi...@gmail.comwrote: well, not exactly. But I can help you (so can others) to go through code flow (it will probably be tedious) you have a position you start and a certain distance from that point (in a circle) From thereon you substract start(x,y) from dest(x,y) by substracting x from x and y from y the diffence is the amount of degrees between the two points are apart, if you add instead you determine a point. so for example you are currently at long: 75, lat: 31 and you want to know some point 6.9 miles away. you start by adding 0 to 75 and 0.1 to 31 you then have one point (both are degrees and one degree is roughly 69 miles) you can also do the opposite, add 0.1 to 75 and 0 to 31, you can also add 0.05 to both (again totaling 0.1), mind though the values that total 0.1 are absolute, even though the long/lat may be negative. The point is that the values added are combined the distance you want to measure against. From thereon you can determine if there is an address at the location (using reverse geo-coding). when increasing the number you add, you measure further and further you'll have to do that all arround the point you started from more information about how long/lat works: http://www.nationalatlas.gov/articles/mapping/a_latlong.html HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table snip / You should be careful of statements like one degree is roughly 69 miles. While this is true for latitude, it is only true for longitude at the equator. To get the distance between two sets of latlon coordinates, you need to use the great circle equation: http://www.movable-type.co.uk/scripts/latlong.html -- --Zootboy Sent from some sort of computing device.
Re: [PHP] Re: Stupid question
Perhaps he could share all relevant code, since at this time we are mostly guessing. Declaration/assignment of a lot of variables isn't included in the snippets. HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/27 Jim Giner jim.gi...@albanyhandball.com On 2/26/2013 4:27 PM, Curtis Maurand wrote: I have the following: $dsn = mysqli://$username:$password@**$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_**FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_**ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis This may be that stupid answer, but I see what appears to be two problems. 1 - $result is not declared globally in your function header, so hence it's undefined, hence all of its methods are. 2 - you have a couple indices wrapped in curly braces, not parens. Is that some new kind of syntax I'm not aware of? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
Hi, I'm getting: Call to undefined method MDB2_Error::fetchrow() Have your checked if $dbh-query() throws an error? It seems $result is a different type than expected. HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/26 Curtis Maurand cur...@maurand.com On 2/26/2013 4:33 PM, Daniel Brown wrote: On Tue, Feb 26, 2013 at 4:27 PM, Curtis Maurand cur...@maurand.com wrote: I have the following: $dsn = mysqli://$username:$password@**$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_**FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_**ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis Hate to answer a question with a question, but: 1.) Do you have the PEAR package MDB2 installed? 2.) Where is $result defined? I don't see it in your code snippet here. Sorry, $myquery = SELECT * from tbl_Cart where u_ID='$_u_id'; echo $myquery; $result = $dbh-query($myquery); I then tried setting the buffering to true and did a if($result-numrows() 0) and wrapped it around the entire fetchrow loop and I still get the same thing. I just took a look and the libraries are installed if not a bit outdated, but they are there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP to run sequential SQL queries?
Hi, We were thinking to implement the solution as Stored Procedures instead of a PHP solution that runs SQL queries, but an article in Coding Horro recommendeds to avoid SP for good reasons: The article shows only one thing. that common practice should be to 'do everything where it belongs' If you implement this practice within your application, it becomes more maintainable, more performant and easier to develop. Also, to determine the styles used to write your code, is almost entirely dependent on a few things: * Programmer's preference * The problem you are solving * The standards that are commonly used in the environment you are in Is there any benefit to use OOP in these situations? Benefits of OOP are that it becomes easier to implement a more standardized code structure, better match with reality, clearer code, more structure, re-usability, and a modular design. These can all be done in procedural code as well, the difference being you need a different mind- and skillset. HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/17 Marco Behnke ma...@behnke.biz Am 17.02.13 17:00, schrieb AmirBehzad Eslami: Dear list, We have a bunch of SQL-queries, they should be executed in a sequential order, with a defensive programming style in mind. I don't understand what you want? Queries are executed sequentially or do you plan to create a multi-process PHP application? We were thinking to implement the solution as Stored Procedures instead of a PHP solution that runs SQL queries, but an article in Coding Horro recommendeds to avoid SP for good reasons: http://www.codinghorror.com/blog/2004/10/who-needs-stored-procedures-anyways.html Now we're going to carry on in PHP, and my experience says that we should write the solution in a procedural-style, instead of OOP. Is there any benefit to use OOP in these situations? Please share your thoughts. Thanks, -behzad -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz
Re: [PHP] date problem
Hi. date returns a string You should compare a different type for bigger/smaller than HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/1/3 Marc Fromm marc.fr...@wwu.edu I am comparing to dates. define('WSOFFBEGIN','09/16/2012'); $jes = 01/03/2012; if ( date(m/d/Y, strtotime($jes)) date(m/d/Y, strtotime(WSOFFBEGIN)) ) { $error = MUST begin after . WSOFFBEGIN . \n; } I cannot figure out why the $error is being assigned inside the if statement, since the statement should be false. 01/03/2012 is not less than 09/16/2012. Marc
Re: [PHP] bucle while for to msqyl
Hi, if ($numero == 1) reset; continue; break; } while (true); If the $numero is equal to 1 reset seems odd reset is a function.and requires an array Based on your code, this would run indefintely Since there are no braces after the if statement, only the first statement is executed when $numero equals 1 Also, is this your actual code? If not and possible please add that HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com hi! im new in this forum, i not speak very good english, apologise im spanish. I have a problem, need one infinit bucle to mysql only true if false break this, for example: prueba.php: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) reset; continue; break; } while (true); ? 3 connect to mysql conexion.php: ? $conexion = mysql_connect(localhost, alexis, 123456); mysql_select_db(probando, $conexion); $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } echo $numero; } mysql_close($conexion); ? What I do is to run the loop as long as the value $ number is equal to 1 in mysql I have a single field called n with the value 1 and runs, now the problem is the next, I run the loop with the value 1 in mysql and it runs fine but when I go to mysql and change the value to 2 (which would be an incorrect and should leave) the loop ignores him and continues running, I was reading a lot about the loops but I can not make it work in this way could you please give me a hand with this? or if I'm wrong What else I can do an infinite command if it fulfills a function and if they do not?. Best regards
Re: [PHP] bucle while for to msqyl
Also, if $numero equals 1, it always prints 1. Is that the expected behaviour? When it does not match 1, it does nothing except it echos 1 twice, first in the conexion.php and second in the first iteration of the while loop Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com 2012/9/16 El Ale... alexissauc...@gmail.com Im sorry reset; is not, this is: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) continue; break; } while (true); ? Thanks! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Hi, if ($numero == 1) reset; continue; break; } while (true); If the $numero is equal to 1 reset seems odd reset is a function.and requires an array Based on your code, this would run indefintely Since there are no braces after the if statement, only the first statement is executed when $numero equals 1 Also, is this your actual code? If not and possible please add that HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com hi! im new in this forum, i not speak very good english, apologise im spanish. I have a problem, need one infinit bucle to mysql only true if false break this, for example: prueba.php: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) reset; continue; break; } while (true); ? 3 connect to mysql conexion.php: ? $conexion = mysql_connect(localhost, alexis, 123456); mysql_select_db(probando, $conexion); $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } echo $numero; } mysql_close($conexion); ? What I do is to run the loop as long as the value $ number is equal to 1 in mysql I have a single field called n with the value 1 and runs, now the problem is the next, I run the loop with the value 1 in mysql and it runs fine but when I go to mysql and change the value to 2 (which would be an incorrect and should leave) the loop ignores him and continues running, I was reading a lot about the loops but I can not make it work in this way could you please give me a hand with this? or if I'm wrong What else I can do an infinite command if it fulfills a function and if they do not?. Best regards
Re: [PHP] bucle while for to msqyl
Since the value is never changed inside the loop, it will run indefintely or stop immediately. You need to re-request the value from the database to change $numero to a possible other value. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com yes it 1 = 1 its (true) bucle's run, but! if 1 is not same 1 bucle break. when consulted database and this value is 1, the loop continues, but when changing the value of the database for example value 2, the loop should stop because 1 is not equal to 2 but not Doing so ignores it and segue running as if the value is one, that's the problem Thank you! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Also, if $numero equals 1, it always prints 1. Is that the expected behaviour? When it does not match 1, it does nothing except it echos 1 twice, first in the conexion.php and second in the first iteration of the while loop Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com 2012/9/16 El Ale... alexissauc...@gmail.com Im sorry reset; is not, this is: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) continue; break; } while (true); ? Thanks! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Hi, if ($numero == 1) reset; continue; break; } while (true); If the $numero is equal to 1 reset seems odd reset is a function.and requires an array Based on your code, this would run indefintely Since there are no braces after the if statement, only the first statement is executed when $numero equals 1 Also, is this your actual code? If not and possible please add that HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com hi! im new in this forum, i not speak very good english, apologise im spanish. I have a problem, need one infinit bucle to mysql only true if false break this, for example: prueba.php: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) reset; continue; break; } while (true); ? 3 connect to mysql conexion.php: ? $conexion = mysql_connect(localhost, alexis, 123456); mysql_select_db(probando, $conexion); $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } echo $numero; } mysql_close($conexion); ? What I do is to run the loop as long as the value $ number is equal to 1 in mysql I have a single field called n with the value 1 and runs, now the problem is the next, I run the loop with the value 1 in mysql and it runs fine but when I go to mysql and change the value to 2 (which would be an incorrect and should leave) the loop ignores him and continues running, I was reading a lot about the loops but I can not make it work in this way could you please give me a hand with this? or if I'm wrong What else I can do an infinite command if it fulfills a function and if they do not?. Best regards
Re: [PHP] bucle while for to msqyl
If you wrap the query inside your while loop at the point where you want to check for a change of the value it will change at every iteration. For ease of use, it would be better to create a function around the data gathering part, i.e. function updateNumero() { $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } } return $numero; } Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com How could I?, should use another command? I need to do that if the value of the script is the same as the database and repeat but stops. greetings! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Since the value is never changed inside the loop, it will run indefintely or stop immediately. You need to re-request the value from the database to change $numero to a possible other value. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com yes it 1 = 1 its (true) bucle's run, but! if 1 is not same 1 bucle break. when consulted database and this value is 1, the loop continues, but when changing the value of the database for example value 2, the loop should stop because 1 is not equal to 2 but not Doing so ignores it and segue running as if the value is one, that's the problem Thank you! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Also, if $numero equals 1, it always prints 1. Is that the expected behaviour? When it does not match 1, it does nothing except it echos 1 twice, first in the conexion.php and second in the first iteration of the while loop Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com 2012/9/16 El Ale... alexissauc...@gmail.com Im sorry reset; is not, this is: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) continue; break; } while (true); ? Thanks! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Hi, if ($numero == 1) reset; continue; break; } while (true); If the $numero is equal to 1 reset seems odd reset is a function.and requires an array Based on your code, this would run indefintely Since there are no braces after the if statement, only the first statement is executed when $numero equals 1 Also, is this your actual code? If not and possible please add that HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com hi! im new in this forum, i not speak very good english, apologise im spanish. I have a problem, need one infinit bucle to mysql only true if false break this, for example: prueba.php: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) reset; continue; break; } while (true); ? 3 connect to mysql conexion.php: ? $conexion = mysql_connect(localhost, alexis, 123456); mysql_select_db(probando, $conexion); $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } echo $numero; } mysql_close($conexion); ? What I do is to run the loop as long as the value $ number is equal to 1 in mysql I have a single field called n with the value 1 and runs, now the problem is the next, I run the loop with the value 1 in mysql and it runs fine but when I go to mysql and change the value to 2 (which would be an incorrect and should leave) the loop ignores him and continues running, I was reading a lot about the loops but I can not make it work in this way could you please give me a hand with this? or if I'm wrong What else I can do an infinite command if it fulfills a function and if they do not?. Best regards
Re: [PHP] bucle while for to msqyl
I do not understand is where the loop would do, what I need to remember is that if it is true to repeat the condition and if false stops. Well, it depends Where do you want to check if the value changes? And, perhaps more importantly, what is the problem you are trying to solve? Since you retrieve all values from the database, but only use the last one. Does that mean you are trying to determine if the last value has changed (either through INSERT or UPDATE)? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/17 El Ale... alexissauc...@gmail.com ? $conexion = mysql_connect(localhost, usuario, 123456); mysql_select_db(probando, $conexion); function updateNumero() { $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } } return $numero; } ? in this way? I do not understand is where the loop would do, what I need to remember is that if it is true to repeat the condition and if false stops. Thanks! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com If you wrap the query inside your while loop at the point where you want to check for a change of the value it will change at every iteration. For ease of use, it would be better to create a function around the data gathering part, i.e. function updateNumero() { $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } } return $numero; } Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com How could I?, should use another command? I need to do that if the value of the script is the same as the database and repeat but stops. greetings! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Since the value is never changed inside the loop, it will run indefintely or stop immediately. You need to re-request the value from the database to change $numero to a possible other value. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com yes it 1 = 1 its (true) bucle's run, but! if 1 is not same 1 bucle break. when consulted database and this value is 1, the loop continues, but when changing the value of the database for example value 2, the loop should stop because 1 is not equal to 2 but not Doing so ignores it and segue running as if the value is one, that's the problem Thank you! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Also, if $numero equals 1, it always prints 1. Is that the expected behaviour? When it does not match 1, it does nothing except it echos 1 twice, first in the conexion.php and second in the first iteration of the while loop Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com 2012/9/16 El Ale... alexissauc...@gmail.com Im sorry reset; is not, this is: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) continue; break; } while (true); ? Thanks! 2012/9/16 Serge Fonville serge.fonvi...@gmail.com Hi, if ($numero == 1) reset; continue; break; } while (true); If the $numero is equal to 1 reset seems odd reset is a function.and requires an array Based on your code, this would run indefintely Since there are no braces after the if statement, only the first statement is executed when $numero equals 1 Also, is this your actual code? If not and possible please add that HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/16 El Ale... alexissauc...@gmail.com hi! im new in this forum, i not speak very
Re: [PHP] Re: Programmers and developers needed
2012/9/14 Kiek Bailey kbai...@howlermonkey.net On 9/13/2012 7:39 PM, Jim Giner wrote: On 9/13/2012 3:45 AM, agbo onyador wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. really?? A world wide system? And this is how you advertise it? I thiknk he's still building it, not advertising it. Still, methinks i detect a bit of a whiff, but it could be my pits... Or the fact that since the 'announcement' , there were no further responses from him (her?) Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/14 Kiek Bailey kbai...@howlermonkey.net On 9/13/2012 7:39 PM, Jim Giner wrote: On 9/13/2012 3:45 AM, agbo onyador wrote: Hello there! We are looking for programmers and developers to create a world wide system. Your comments are welcome. really?? A world wide system? And this is how you advertise it? I thiknk he's still building it, not advertising it. Still, methinks i detect a bit of a whiff, but it could be my pits... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MS SQL server connection problem.
Hi, why do I need a native client or ODBC driver when I already got this driver installed in my system. You need the Native Client on top of the PHP driver. The PHP driver implements functions that enable PHP to talk to SQL Server through the Native Client. HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/5 Girish Talluru girish.dev1...@gmail.com Hi All, I'm having problem while connecting to MS SQL server from my php program. I tried downloading driver from Microsoft and changed php.ini file but it is showing the following error. This statement I used to connect. $connect = mssql_connect(localhost, PC6, password); This is the error message I got Call to undefined function mssql_connect() in C:\wamp\www\Test\dbTest.php Then I tried other one as shown below: This statement I used to connect. $connect = sqlsrv_connect(localhost, PC6, password); This is the error message I got Array ( [0] = Array ( [0] = IMSSP [SQLSTATE] = IMSSP [1] = -49 [code] = -49 [2] = This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] = This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] = Array ( [0] = IM002 [SQLSTATE] = IM002 [1] = 0 [code] = 0 [2] = [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] = [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) ) It is asking to download a native client. but i have already downloaded a driver at http://www.microsoft.com/en-in/download/details.aspx?id=20098 named SQLSRV30.EXE why do I need a native client or ODBC driver when I already got this driver installed in my system. Please help me out with this guys. I'm new to this. Thanks, Girish Talluru
Re: [PHP] ksort by value
Hi, Have you looked at http://php.net/manual/en/array.sorting.php? Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/3 John Taylor-Johnston jt.johns...@usherbrooke.ca ?php ... $words = preg_split('/[[:space:]]+/',$**mynewstring); foreach ($words as $word) { $freq[$word]++; } ksort($freq); print_r ($freq); ? ksort($freq) sorts the array by the key. And that works fine. But I would also like to sort by value to see which words are more frequent. There is no |ascending/descending option to ksort?| ksort sorts by key, if you want by value, look at sort. As to asc/desc sort, they just have a different name. ksort and sort are asc, krsort and rsort are desc equivalents. - Matijn I'm fuzzy when it comes to arrays. I never get what I want right. Sort does not work seamlessly. I have my key and sort($freq); print_r ($freq); looks like: Array ( ... [1000] = 172 [1001] = 176 [1002] = 179 [1003] = 441 ) This is what I want: Array ( ... [and] = 172 [of] = 176 [to] = 179 [the] = 441 ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ksort by value
Sort does not maintain the association between key and value. Use asort to sort on value while maintaining the key. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/3 John Taylor-Johnston jt.johns...@usherbrooke.ca ?php ... $words = preg_split('/[[:space:]]+/',$mynewstring); foreach ($words as $word) { $freq[$word]++; } ksort($freq); print_r ($freq); ? Sort does not work seamlessly. I have my key and sort($freq); print_r ($freq); looks like: Array ( ... [1000] = 172 [1001] = 176 [1002] = 179 [1003] = 441 ) This is what I want: Array ( ... [and] = 172 [of] = 176 [to] = 179 [the] = 441 ) http://php.net/manual/en/array.sorting.php is pretty clear. But my problem is that sort ($freq) destroyed my key.
Re: [PHP] ksort by value
If you want to perform a count on all the unique values (in SQL Terms a group by and a count) use http://php.net/manual/en/function.array-count-values.php instead. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/3 Serge Fonville serge.fonvi...@gmail.com Sort does not maintain the association between key and value. Use asort to sort on value while maintaining the key. Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/3 John Taylor-Johnston jt.johns...@usherbrooke.ca ?php ... $words = preg_split('/[[:space:]]+/',$mynewstring); foreach ($words as $word) { $freq[$word]++; } ksort($freq); print_r ($freq); ? Sort does not work seamlessly. I have my key and sort($freq); print_r ($freq); looks like: Array ( ... [1000] = 172 [1001] = 176 [1002] = 179 [1003] = 441 ) This is what I want: Array ( ... [and] = 172 [of] = 176 [to] = 179 [the] = 441 ) http://php.net/manual/en/array.sorting.php is pretty clear. But my problem is that sort ($freq) destroyed my key.
Re: [PHP] Hmm.. this is strange..
Hi, Instead of just checking if the variable is not set, additionally check if it is empty Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Google!! They need to add GAL support on Android (star to agree) http://code.google.com/p/android/issues/detail?id=4602 2012/4/24 Karl-Arne Gjersøyen karlar...@gmail.com: Hello. I have a upload form in a html file and a corresponding PHP file that shall take care of the information. But I am doing something newbie error here.. What am I doing wrong? (The text is norwegian, but you still see and understand the PHP code) bildegalleri.html - !DOCTYPE html html lang=no head meta charset=utf-8 titleOpplasting til Fotogalleri/title link rel=stylesheet href=standard.css media=screen /head body h1Opplasting til Fotogalleri/h1 form action=bildegalleri.php method=post enctype=multipart/form-data fieldset legendVelg bilde for opplasting/legend label for=filbaneFilbane/labelbr input type=file id=filbane name=filbane input type=submit name=last_opp_fil value=Last opp bildet /fieldset /form /body /html bildegalleri.php - ?php if(!isset($_POST['last_opp_fil'])){ header('Location: bildegalleri.html'); } elseif(empty($_FILES['filbane'])){ header('Location: bildegalleri.html'); } else { ? !DOCTYPE html html lang=no head meta charset=utf-8 titleBildegalleri/title /head body h1Bildegalleri/h1 ?php echo OK; } ? /body /html When I run this script, I always get Ok. Even when the input file field is empty.. Can someone tell me what I am doing wroing in this? Thanks for you time and effort to help me out. Karl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NULL Problem
Have you considered the PHP MSSQL driver? http://www.microsoft.com/download/en/details.aspx?id=20098 Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Google!! They need to add GAL support on Android (star to agree) http://code.google.com/p/android/issues/detail?id=4602 2012/4/24 Matijn Woudt tijn...@gmail.com: On Tue, Apr 24, 2012 at 7:29 PM, David Stoltz dsto...@shh.org wrote: Here's my code (using MSSQL): $conn = new COM (ADODB.Connection)or die(Cannot start ADO); $conn-open($connStr); $query = SELECT * FROM TABLE WHERE id = .$id; $rs = $conn-execute($query); This code works fine, and I retrieve the values like this: $tmp1 = $rs-fields(column1); $tmp2 = $rs-fields(column2); Etc... Here's the problem - I'm trying to get a date column that I know is NULL, but I can't seem to get my code right: $tmp = $rs-fields(followup_on); if(is_null($tmp)){ $followup = ; }else{ $followup = $rs-fields(followup_on); } //this results in: Catchable fatal error: Object of class variant could not be converted to string //When I try to ECHO the $followup results (and I know the database value is NULL) So confused - any advice? It's been a long time ago I worked with ADO (Thank god), but shouldn't you echo $followup-value instead of $followup? If that's not working, try a var_dump($followup), so you can check exactly what it is. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php