php-windows Digest 12 Jan 2001 21:21:45 -0000 Issue 393 Topics (messages 4943 through 4958): Re: Inner Joins 4943 by: Tom 4948 by: Pablo Vera Resize function jpeg/gif 4944 by: 2FIT mverstegen problems with time diffrences 4945 by: Tomasz Abramowicz 4946 by: Paul Meagher 4947 by: Nol Shala 4949 by: Pablo Vera DB Select Limits 4950 by: Ben Cairns 4951 by: Tom 4952 by: Gregory_Griffiths.cargill.com Simple question that I can't find the answer to 4953 by: Asendorf, John 4956 by: Daniel Beulshausen 4957 by: Asendorf, John One-way Hash function 4954 by: Julian Easterling 4955 by: Gonzalo Vera problem with checkdate () 4958 by: Asendorf, John 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] ----------------------------------------------------------------------
Your question is already answered, but for future ref, I debug all my SQL by running it at the command prompt to ensure that the version of MySQL that I'm using actually recognises the commands (alternatively trawl through the command list in the MySQL manual to see what the developers have to say about limitations and non-ansi SQL implementation/extensions, but this can take some time!) Tom "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]
Debra: I encountered something similar a while ago when I was using version 3.22, and I seem to recall from the MySQL manual that INNER JOINS are performed like this: SELECT t1.a, t1.b, t2.c FROM t1, t2 WHERE t1.a = t2.a When youn link tables to Access, the SQL statements used should follow Access syntax. From PHP, they follow MySQL syntax. Saludos, Pablo Vera _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Thursday, January 11, 2001, 3:08:52 PM, debra wrote: sd> I am writing some PHP code with calls to Mysql. I am trying to do a Inner sd> join and I am not getting any results back from my query (and no errors). sd> If I cut the Inner join out of the SQL statement it works. sd> If I link the MySql tables into Microsoft Access and run the exact SQL sd> statement it works with the correct results. sd> Is there any special syntax that PHP requires for inner joins? I'm running sd> PHP 3.0.11 and Mysql 3.22.34 on NT 4.0 with Apache (of course). sd> 'SELECT tbl_cip.CIP, tbl_cip.Originator, tbl_cip.Coordinator, sd> tbl_cip.AproveCancel, sd> tbl_cip.Actionees, tbl_cip.Director, tbl_cip.Repeat, sd> tbl_cip.HoldPending, sd> tbl_cip.Auditor, tbl_cip.Verifier, tbl_cip.Date sd> FROM tbl_cip sd> INNER JOIN tbl_formid ON tbl_cip.FormID = sd> tbl_formid.FormID'; sd> Debra Samsom sd> Bristol Aerospace Ltd. sd> (204) 775-8331 3402 sd> [EMAIL PROTECTED]
Hi, I've seen that the GD extension provides functions to create and manipulate images. I didn't find a function to resize an image. Is a resize possible with PHP or do I have to call an external function? Regards, Martin Verstegen 2FIT
I have hosting in the states, but develop sites in europe, this gives me a +7 hour time diffrence. how can i modify date(); to give me CET?
I believe you need to set a "tz" variable before you call your date functions. If you do a search for "tz" in the mailing list archives you can probably find a snippet that will show you how to do it. Regards, Paul ----- Original Message ----- From: "Tomasz Abramowicz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 12, 2001 10:35 AM Subject: [PHP-WIN] problems with time diffrences > I have hosting in the states, but develop > sites in europe, this gives me a +7 hour > time diffrence. how can i modify date(); > to give me CET? > > > -- > 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] > >
Well I don't know how you can adjust it for CET, but I it helps you can use GMT time. For local settings of time and language please check this page http://www.php.net/manual/function.gmstrftime.php Greetings Nol ----- Original Message ----- From: "Tomasz Abramowicz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 12, 2001 3:35 PM Subject: [PHP-WIN] problems with time diffrences > I have hosting in the states, but develop > sites in europe, this gives me a +7 hour > time diffrence. how can i modify date(); > to give me CET? > > > -- > 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] > >
Tomasz: You could do something like this: $my_time = time() - 7*3600; // substract 7 hours to hosting time $my_date = date($format, $my_time); $format is the string you are using to format the date/time. Saludos, Pablo Vera _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Friday, January 12, 2001, 8:35:04 AM, Tomasz wrote: TA> I have hosting in the states, but develop TA> sites in europe, this gives me a +7 hour TA> time diffrence. how can i modify date(); TA> to give me CET?
I have a web board script that I need to impose a limit on the database select. I tried using: SELECT * FROM posts where of_forum='$forum_num' AND POST_ID <= '$upper' AND POST_ID >= '$lower' and SELECT * FROM posts where of_forum='$forum_num' ORDER BY POST_ID desc LIMIT '$lower','$upper' $lower and $upper are defined from the url. But that doesn't seem to work. Any ideas? -- 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......"
By 'Doesn't seem to work' what do you mean? Does it return no results (and how do you know that this is the case and that its not some typo elsewhere) or does it give an error message - if so , what? Tom Ben Cairns wrote: > I have a web board script that I need to impose a limit on the database > select. > > I tried using: > SELECT * FROM posts where of_forum='$forum_num' AND POST_ID <= '$upper' AND > POST_ID >= '$lower' > and > SELECT * FROM posts where of_forum='$forum_num' ORDER BY POST_ID desc LIMIT > '$lower','$upper' > > $lower and $upper are defined from the url. > > But that doesn't seem to work. Any ideas? > > -- 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]
> -----Original Message----- > From: Griffiths, Gregory D. /here > Sent: 12 January 2001 16:08 > To: '[EMAIL PROTECTED]' > Subject: RE: [PHP-WIN] DB Select Limits > > > does your database support the LIMIT keyword ? > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: 12 January 2001 15:59 > > To: [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subject: FW: [PHP-WIN] DB Select Limits > > > > > > I have a web board script that I need to impose a limit on > > the database > > select. > > > > I tried using: > > SELECT * FROM posts where of_forum='$forum_num' AND POST_ID > > <= '$upper' AND > > POST_ID >= '$lower' > > and > > SELECT * FROM posts where of_forum='$forum_num' ORDER BY > > POST_ID desc LIMIT > > '$lower','$upper' > > > > $lower and $upper are defined from the url. > > > > But that doesn't seem to work. Any ideas? > > > > > > -- 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] > > > > >
Is there a single line of code to do the following? I'm trying to interchange two variables' contents... I can do it with the following, but I was just wondering... I can't find it if there is... $a = "abc"; $b = "def"; $temp = $b; $b = $a; $a = $temp; //now $a = "def" and $b = "abc" Thanks in advance, John --------------------- Founder of The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods, Bod John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur.
At 14:19 12.01.2001 -0500, Asendorf, John wrote: >Is there a single line of code to do the following? > >I'm trying to interchange two variables' contents... I can do it with the >following, but I was just wondering... I can't find it if there is... > >$a = "abc"; >$b = "def"; > >$temp = $b; >$b = $a; >$a = $temp; > >//now $a = "def" and $b = "abc" the question would be why you have to exchange the variablenames, maybe you can use variable variables $$ or ${}. i depends on what you want to do. daniel /*-- daniel beulshausen - [EMAIL PROTECTED] using php on windows? http://www.php4win.de
I have a set of date selectors which then people can use to search between two dates. Even though they say FROM and TO, people will undoubtedly put the dates in the wrong order on occassion. If this happens (I've already got the IF statement), I want to be able to switch the two dates before the SQL is written instead of having it die ("Hey idiot, go back and switch the dates you've entered"); :) --------------------- 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: Daniel Beulshausen [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 12, 2001 3:29 PM > To: Asendorf, John; Php-Windows (E-mail) > Subject: Re: [PHP-WIN] Simple question that I can't find the answer to > > > At 14:19 12.01.2001 -0500, Asendorf, John wrote: > >Is there a single line of code to do the following? > > > >I'm trying to interchange two variables' contents... I can > do it with the > >following, but I was just wondering... I can't find it if > there is... > > > >$a = "abc"; > >$b = "def"; > > > >$temp = $b; > >$b = $a; > >$a = $temp; > > > >//now $a = "def" and $b = "abc" > > the question would be why you have to exchange the > variablenames, maybe you > can use variable variables $$ or ${}. > i depends on what you want to do. > > daniel > > > /*-- > daniel beulshausen - [EMAIL PROTECTED] > using php on windows? http://www.php4win.de > > > -- > 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] >
Does any one have a one-way (non-reversible) hash function? I need to encode some values that can't be read by human, such as password information. Thanks. Julian.
Check out md5 under string functions, in PHP manual. Regards, Gonzalo. > Does any one have a one-way (non-reversible) hash function? I need to > encode some values that can't be read by human, such as password > information. Thanks. > Julian.
I'm trying to check a date... the date is saved as dd-Mon-YY the following code: $frmdatecheck = date ("j, n, Y", strtotime ( $FROMdate ) ); if ( !checkdate ( $frmdatecheck ) ) { } gives me the following error Warning: Wrong parameter count for checkdate() in D:\root\cc\resolutions\res_search.php on line 621 checkdate is defined as int checkdate (int month, int day, int year) any suggestions? Thanks in advace, John --------------------- 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.