php-windows Digest 28 Mar 2001 08:12:26 -0000 Issue 514 Topics (messages 6342 through 6345): Array How To ??? 6342 by: Barry Re: Database search, http headers 6343 by: Luc Servaas HELP!!! (PHP-WINDOWS98-APACHE) 6344 by: Bhala 6345 by: Darvin Andrioli Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Hello Everyone, I would like to sort a list of array indices. The array is multi- dimensional N x 3 for example, if (note the actual data is not important to my question): $a[0]['a'] = 1, $a[0]['b'] = 2, $a[0]['c'] = 3 $a[1]['a'] = 1, $a[1]['b'] = 2, $a[1]['c'] = 3 $a[2]['a'] = 1, $a[2]['b'] = 2, $a[2]['c'] = 3 Q1) I will use the "usort" user sort function. I see the example for multi-dimensional arrays in the manual (they use fruits, not a b c). Does usort work in Windows (NT4 machine, PHP 4.04, running as cgi) ? Q2) The array $a will be stored in a session. I will want to clear $a and then recreate and resort $a. How do I clear a variable or array ? For example, if the first time I create $a it gets up to $a[30] (remember $a is saved in a session), but if I recreate $a and the indices only go to $a[20], I need to be sure $a[21] to $a[30] no longer exist. Easiest way: clear $a before recreating it. Q3) The $a array will be generated from the results of a mysql database query. Is it realistic to save the results set ($res) of a query ($res = mysql_query($sql)) in a session? I think the size of $res won't exceed 32KB. Is there a session storage size limit for Windows? Thanks very much for your experience, Barry.
to search in a database for a field containing a string you can use % signs: select * fro table where field='%$string%' Luc ""Mark Collins"" <[EMAIL PROTECTED]> wrote in message 99nu1n$9nj$[EMAIL PROTECTED]">news:99nu1n$9nj$[EMAIL PROTECTED]... > Hi again, a couple of questions if you have the time. > > I am having trouble writing the code to perform a search on a database. I > have written some code which will search but only get case sensitive exact > match results. Are there any functions or prewritten bits that would help > here? Or can anyone point me in the right direction so I can code it myself? > > Another small problem is that I was working through a tutorial to > authenticate users using HTTP headers, but I am getting the following error, > > Warning: Cannot add header information - headers already sent by (output > started at C:\INetPub\WWWRoot\counter.php:5) in > C:\INetPub\WWWRoot\counter.php on line 15 > > Warning: Cannot add header information - headers already sent by (output > started at C:\INetPub\WWWRoot\counter.php:5) in > C:\INetPub\WWWRoot\counter.php on line 16 > > With the code looking like this, > > if (!isset($PHP_AUTH_USER)) { > header('WWW-Authenticate: Basic realm="My Private Stuff"'); > header('HTTP/1.0 401 Unauthorized'); > echo 'Authorization Required.'; > exit; > } > > I am running php4 on IIS on Windows NT Server. Can you help? Sorry this is > such a long post, I didn't know who else to ask! > > Thanks again > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I NEED HELP! For some resion Apache will not run the php scripts =\ I have tryed different config variables in the httpd.config thing This is what I have in there. ====================== ScriptAlias /php/ "php" AddType application/x-httpd-php .php .phtml .php4 .php3 Action application/x-httpd-php "php/php.exe" ========================= pls help!
Hi, change the following lines: from ScriptAlias /php/ "php" to ScriptAlias /php/ "c:/path/to/your/php/directory/" and the third line from Action application/x-httpd-php "php/php.exe" to Action application/x-httpd-php "/php/php.exe" At the end reboot Apache. Darvin -----Original Message----- From: Bhala [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 4:00 AM To: [EMAIL PROTECTED] Subject: [PHP-WIN] HELP!!! (PHP-WINDOWS98-APACHE) I NEED HELP! For some resion Apache will not run the php scripts =\ I have tryed different config variables in the httpd.config thing This is what I have in there. ====================== ScriptAlias /php/ "php" AddType application/x-httpd-php .php .phtml .php4 .php3 Action application/x-httpd-php "php/php.exe" ========================= pls help!