php-windows Digest 12 Jan 2001 08:41:19 -0000 Issue 392 Topics (messages 4926 through 4942): Re: Probably there is better solution 4926 by: kill-9 4928 by: Gonzalo Vera Re: mail() - Failed to connect 4927 by: Asendorf, John Re: Problem with CURSOR under MS SQL 7 4929 by: Thomas 4930 by: Thomas How do we Redirect a page: Newbie 4931 by: Mujahid 4932 by: Trond A Bråthen 4934 by: adam Inner Joins 4933 by: samsom, debra 4942 by: Larry Forrister Re: error PHP4.0.4 with Apache1.3.12 4935 by: Cynic 4936 by: Cynic compile failure with zlib 1.1.3 on NT5 4937 by: Cynic Re: Removing Content 4938 by: Alain Samoun PHP as a module on Windows 4939 by: adam Re: directory/file comparing 4940 by: Alain Samoun 4941 by: alain samoun 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] ----------------------------------------------------------------------
$result = mysql_query("SELECT any_name_of_column FROM table_name", $db); if (mysql_num_rows($result)==0) { echo "the table is empty "; } check the manual under mysql functions there are a lot of very useful functions there. kill-9 www.kill-9.dk for all your mysql and php needs ----- Original Message ----- From: "afan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 11, 2001 9:24 PM Subject: [PHP-WIN] Probably there is better solution Hi all, I have to know how many entries I have in table/database. Usually, I use $result = mysql_query("SELECT any_name_of_column FROM table_name", $db); while($myrow = mysql_fetch_array($result)); { $Counter++; } echo"No of entries: $Checker<br>\n"; Probably there is better and faster solution. Thanks for any help! Afan
Check out mysql_num_rows and the COUNT function in MySQL: both are good, quick ways of getting that number without looping through your whole result set. Gonzalo. > Hi all, > I have to know how many entries I have in table/database. Usually, I use > $result = mysql_query("SELECT any_name_of_column FROM table_name", $db); > while($myrow = mysql_fetch_array($result)); > { > $Counter++; > } > echo"No of entries: $Checker<br>\n"; > Probably there is better and faster solution. > Thanks for any help! > Afan
Have you set up your SMTP server in your php.ini file? --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 The benefit to the government of replacing all $1 Federal Reserve notes with $1 coins would be $522.2 million per year, according to estimates of the General Accouting Office released on April 7, 2000. > -----Original Message----- > From: Vlad [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 11, 2001 1:56 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] mail() - Failed to connect > > > Hi All > why > mail($to, $subj, $message); > fails with warning Failed to connect at line ... > Thanks Vlad... > > > > -- > 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] >
Hello Mauro, I don't know exactly why your Cursor doesn't work (e.g. a SET ..... desn't work yet also, but will be in the next version). Since you just want simulate the LIMIT (x,y) from mySQL, here's the way I've done it (Simple "countermove-Select"): SELECT TOP $limit WITH TIES * FROM $table WHERE $check2 ID_Fa not in (SELECT TOP $offset WITH TIES ID_Fa FROM $table WHERE $check1 ORDER BY $mySort1 ASC, ID_Fa ASC) ORDER BY $mySort1 ASC, ID_Fa ASC" Hope that helps, Thomas "Mauro Boschi (by way of Mauro Boschi )" wrote: > Hi, > I'm trying to understand why something like this: > > DECLARE crs CURSOR KEYSET FOR > SELECT title FROM article WHERE pub_id = 1 > OPEN crs > FETCH ABSOLUTE 3 FROM crs > DECLARE @var INT > SET @var = 0 > WHILE (@var<10) > BEGIN > FETCH NEXT FROM crs > SET @var = @var +1 > END > CLOSE crs > DEALLOCATE crs > > Doesn't work when you try to embend it in a PHP/MSSQL query!? > There's something that I doesn't mind about this? > Maybe a LOCAL PROCEDURE works better? > > What I have to do is just emulate the LIMIT function that MySQL have in his > set of command. This function is very useful when you have to extract only a > set of row from the query with an absolute start position. > > THANKS A LOT > > Mauro > > -- > 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] > > -- > 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]
Hello Mauro, Sorry! As you maybe have seen, this is another version than the "countermove-select" (bloody copypaste :), but should work anyway. Cu, Thomas Thomas wrote: > Hello Mauro, > > I don't know exactly why your Cursor doesn't work (e.g. a SET ..... desn't work > yet also, but will be in the next version). > Since you just want simulate the LIMIT (x,y) from mySQL, here's the way I've > done it (Simple "countermove-Select"): > > SELECT TOP $limit WITH TIES * FROM $table WHERE $check2 ID_Fa not in > (SELECT TOP $offset WITH TIES ID_Fa FROM $table WHERE $check1 ORDER BY $mySort1 > ASC, ID_Fa ASC) > ORDER BY $mySort1 ASC, ID_Fa ASC" > > Hope that helps, > Thomas > > "Mauro Boschi (by way of Mauro Boschi )" wrote: > > > Hi, > > I'm trying to understand why something like this: > > > > DECLARE crs CURSOR KEYSET FOR > > SELECT title FROM article WHERE pub_id = 1 > > OPEN crs > > FETCH ABSOLUTE 3 FROM crs > > DECLARE @var INT > > SET @var = 0 > > WHILE (@var<10) > > BEGIN > > FETCH NEXT FROM crs > > SET @var = @var +1 > > END > > CLOSE crs > > DEALLOCATE crs > > > > Doesn't work when you try to embend it in a PHP/MSSQL query!? > > There's something that I doesn't mind about this? > > Maybe a LOCAL PROCEDURE works better? > > > > What I have to do is just emulate the LIMIT function that MySQL have in his > > set of command. This function is very useful when you have to extract only a > > set of row from the query with an absolute start position. > > > > THANKS A LOT > > > > Mauro > > > > -- > > 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] > > > > -- > > 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] > > -- > 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]
How do we redirect a user from a PHP page to another ? In ASP I would do a Response.Redirect. What is the equalent function in PHP ? Thanks -MW
Header("Location: http://your.domain.com"); Note; you must do this before anything is sent to the browser. You can easily do this by using Output Buffering. Refer to the manual for more info on OB. ""Mujahid"" <[EMAIL PROTECTED]> wrote in message 93l4q6$8fb$[EMAIL PROTECTED]">news:93l4q6$8fb$[EMAIL PROTECTED]... > How do we redirect a user from a PHP page to another ? > In ASP I would do a Response.Redirect. > What is the equalent function in PHP ? > > Thanks > -MW
Mujahid <[EMAIL PROTECTED]> said: > How do we redirect a user from a PHP page to another ? > In ASP I would do a Response.Redirect. > What is the equalent function in PHP ? > header() header("Location: http://www.something.com/somewhere/"); Note that header() has to be used before anything is output to the browser. Welcome to PHP. adam
I am writing some PHP code with calls to Mysql. I am trying to do a Inner join and I am not getting any results back from my query (and no errors). If I cut the Inner join out of the SQL statement it works. If I link the MySql tables into Microsoft Access and run the exact SQL statement it works with the correct results. Is there any special syntax that PHP requires for inner joins? I'm running PHP 3.0.11 and Mysql 3.22.34 on NT 4.0 with Apache (of course). 'SELECT tbl_cip.CIP, tbl_cip.Originator, tbl_cip.Coordinator, tbl_cip.AproveCancel, tbl_cip.Actionees, tbl_cip.Director, tbl_cip.Repeat, tbl_cip.HoldPending, tbl_cip.Auditor, tbl_cip.Verifier, tbl_cip.Date FROM tbl_cip INNER JOIN tbl_formid ON tbl_cip.FormID = tbl_formid.FormID'; Debra Samsom Bristol Aerospace Ltd. (204) 775-8331 3402 [EMAIL PROTECTED]
The INNER JOIN condition is not allowed in mySQL prior to version 3.23.16. Just put the test "tbl_cip.FormID = tbl_formid.FormID" in the WHERE clause. ~~LF "samsom, debra" wrote: > I am writing some PHP code with calls to Mysql. I am trying to do a > Inner > join and I am not getting any results back from my query (and no > errors). > If I cut the Inner join out of the SQL statement it works. > > If I link the MySql tables into Microsoft Access and run the exact SQL > statement it works with the correct results. > > Is there any special syntax that PHP requires for inner joins? I'm > running > PHP 3.0.11 and Mysql 3.22.34 on NT 4.0 with Apache (of course). > > 'SELECT tbl_cip.CIP, tbl_cip.Originator, tbl_cip.Coordinator, > tbl_cip.AproveCancel, > tbl_cip.Actionees, tbl_cip.Director, tbl_cip.Repeat, > tbl_cip.HoldPending, > tbl_cip.Auditor, tbl_cip.Verifier, tbl_cip.Date > FROM tbl_cip > INNER JOIN tbl_formid ON tbl_cip.FormID = > tbl_formid.FormID'; > > Debra Samsom > Bristol Aerospace Ltd. > (204) 775-8331 3402 > [EMAIL PROTECTED] -- -------------------------------------------- Short people don't need shrinks.
I wanted to build zlib on my machine, but nmake says: NMAKE : fatal error U1073: don't know how to make 'adler32.c' Stop. Does anyone know what's wrong? It's zlib 1.1.3. At 17:59 8.1. 2001, Cynic wrote the following: -------------------------------------------------------------- >the shutdown crash has been there for some time now. >what are the other errors you experience? > > >At 10:01 7.1. 2001, Larry Forrister wrote the following: >-------------------------------------------------------------- >>I have PHP 4.0.4 configured as a module with Apache 1.3.12 under Win2K. >>Apache is configured as a service and seems to start up OK, but causes a >>Dr.Watson error and log when shut down. >>It does this even if no pages have been served. >>It does NOT do this if I remove php references from httpd.conf. >>The php module is being loaded. PHP scripts are processed, with some errors. >>No errors are reported in the apache/php logs. >> >>PHP dll is at c:\PHP >>requisite httpd.conf lines: >>LoadModule php4_module "C:/php/php4apache.dll" >>AddType application/x-httpd-php .php >> >> >>Any help please! >>~~LF >> >> >>-- >>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] >------end of quote------ > > > >____________________________________________________________ >Cynic: > >A member of a group of ancient Greek philosophers who taught >that virtue constitutes happiness and that self control is >the essential part of virtue. > >[EMAIL PROTECTED] > > > >-- >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] ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
Oh, great, I screwed up. Larry I'm sorry. At 22:38 11.1. 2001, Larry Forrister ,[EMAIL PROTECTED] wrote the following: -------------------------------------------------------------- >I wanted to build zlib on my machine, but nmake says: > >NMAKE : fatal error U1073: don't know how to make 'adler32.c' >Stop. > >Does anyone know what's wrong? It's zlib 1.1.3. > >At 17:59 8.1. 2001, Cynic wrote the following: >-------------------------------------------------------------- >>the shutdown crash has been there for some time now. >>what are the other errors you experience? >> >> >>At 10:01 7.1. 2001, Larry Forrister wrote the following: >>-------------------------------------------------------------- >>>I have PHP 4.0.4 configured as a module with Apache 1.3.12 under Win2K. >>>Apache is configured as a service and seems to start up OK, but causes a >>>Dr.Watson error and log when shut down. >>>It does this even if no pages have been served. >>>It does NOT do this if I remove php references from httpd.conf. >>>The php module is being loaded. PHP scripts are processed, with some errors. >>>No errors are reported in the apache/php logs. >>> >>>PHP dll is at c:\PHP >>>requisite httpd.conf lines: >>>LoadModule php4_module "C:/php/php4apache.dll" >>>AddType application/x-httpd-php .php >>> >>> >>>Any help please! >>>~~LF >>> >>> >>>-- >>>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] >>------end of quote------ >> >> >> >>____________________________________________________________ >>Cynic: >> >>A member of a group of ancient Greek philosophers who taught >>that virtue constitutes happiness and that self control is >>the essential part of virtue. >> >>[EMAIL PROTECTED] >> >> >> >>-- >>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] >------end of quote------ > > >____________________________________________________________ >Cynic: > >A member of a group of ancient Greek philosophers who taught >that virtue constitutes happiness and that self control is >the essential part of virtue. > >[EMAIL PROTECTED] ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
I wanted to build zlib on my machine, but nmake says: NMAKE : fatal error U1073: don't know how to make 'adler32.c' Stop. Does anyone know what's wrong? It's zlib 1.1.3. ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
Yeah, but if he wants to know the pond, he better swim in it, he will learn by his mistakes, like we all do... Alain On Thu, Jan 11, 2001 at 08:24:18PM +0100, kill-9 wrote: > alain I agree with you but its a big fish pond and the fish he is looking > for is in one corner of it wouldn't it be nice to at least tell him what > section of the pond to look in? > > Ben: check the manual under string functions most of what you need is > there. > > kill-9 > www.kill-9.dk > for all your php and mysql needs. > > > ----- Original Message ----- > From: "Alain Samoun" <[EMAIL PROTECTED]> > To: "Ben Cairns" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Thursday, January 11, 2001 7:24 PM > Subject: Re: [PHP-WIN] Removing Content > > > > Ben: > > People here can give you a lot of different solutions (more or less > > 'elegant') to solve your problem. But it seems that at this point, you > need > > to READ THE MANUAL or at least to get the description of the many PHP > > functions (Booklet from RASMUS at O'Reilly for example). > > You know the story of the fish and fishing pole... > > I like this version: > > "Teach them how to fish, you will be able to sell them a lot of fishing > > poles." ;) > > > > Alain > > > > On Thu, Jan 11, 2001 at 10:00:03AM +0000, Ben Cairns wrote: > > > I have a script that looks at a web page, parses it and grab the HTML > content > > > between two Tags, then outputs the result to a file. > > > > > > What I need to do is another script to read this file, remove more text > > > between two tags, and then display this. > > > > > > How can I do this? > > > > > > -- Ben Cairns - Head Of Technical Operations > > > intasept.COM > > > Tel: 01332 365333 > > > Fax: 01332 346010 > > > E-Mail: [EMAIL PROTECTED] > > > Web: http://www.intasept.com > > > > > > "MAKING sense of > > > the INFORMATION > > > TECHNOLOGY age > > > @ WORK......" > > > > > > > > > -- > > > 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] > > > > -- > > 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] > > > > > > > -- > 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]
Ok, I have to ask - can you run PHP as a module on a stock Apache intall on Windows? I've tried it here several times, and I just can't seem to get it to work. I get the EAPI/DEAPI error, which seems to imply that you have to compile Apache on Win32 to do it. When I load a page, I get a "unable to include" error message. One other thing while I'm here - why was PHP changed to only accept full Windows paths? Before I was able to have a path like "/path/to/file" if the PHP binary files were on the same drive. In the last few releases though, I have to use something like "F:/path/to/file". This makes offline development just a wee bit more painful. Cheers, adam
Have look at: www.suneworld.com/programs/ I don't know if the sources are available? Alain On Thu, Jan 11, 2001 at 07:36:31PM +1300, phobo wrote: > Has anyone out there written, or know of sorce for a directory comparing > algorythm? > > I want it to compare two folders (and their subfolders) on: > - different filesize > - different time/date modifed > - files which are not found in the other folder > > When it outputs the data I want it to show two columns, listing files > vertically file for file highlighting any file which is newer or bigger than > its counterpart. Files which don't have a counterpart will be visiable > because the other column will be blank. > > I could sit down for a few hours and code it but if its already out there, > why bother? I release my code out to people so that they dont have to > reinvent the wheel, like I often seem to do. > > Siggy > > > -- > 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]
Also look at: http://zend.com/search_code_author.php?author=bleach Alain phobo wrote: > > Has anyone out there written, or know of sorce for a directory comparing > algorythm? > > I want it to compare two folders (and their subfolders) on: > - different filesize > - different time/date modifed > - files which are not found in the other folder > > When it outputs the data I want it to show two columns, listing files > vertically file for file highlighting any file which is newer or bigger than > its counterpart. Files which don't have a counterpart will be visiable > because the other column will be blank. > > I could sit down for a few hours and code it but if its already out there, > why bother? I release my code out to people so that they dont have to > reinvent the wheel, like I often seem to do. > > Siggy > > -- > 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]