php-general Digest 16 Mar 2002 17:13:08 -0000 Issue 1230

Topics (messages 88732 through 88749):

Re: Newman, using " and ' or ` in My Sql
        88732 by: Jason Wong
        88735 by: David Robley
        88736 by: mnc.stoic.net

Somebody knows about SecureLink?
        88733 by: Jan Grafström

browser caching
        88734 by: Peter Hall

Re: Weird?
        88737 by: scott furt

Increment a value in a MySQL database with one query?
        88738 by: Kevin Stone
        88739 by: mnc.stoic.net
        88740 by: Kevin Stone

IMAGE Manipulation
        88741 by: Dani
        88742 by: Marcel Besancon

QA help needed
        88743 by: James Cox

Re: [PHP-QA] QA help needed
        88744 by: Liz

Formatting input text?
        88745 by: Andre Dubuc

Problem with sessions.
        88746 by: Carlos Costa Portela

PHP Document not found
        88747 by: Jan Weidhaase

where is http_cookie ?
        88748 by: Bas Jobsen

server load
        88749 by: caspar kennerdale

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
On Saturday 16 March 2002 13:08, Philip J. Newman wrote:
> A few of us folk at PhilipNZ.com would like to know about using " and ' or
> ` in My Sql when calling information from the database.
>
> we have always used
>
> $sql = "SELECT * FROM `hyperlinks` ORDER BY `clicks` DESC LIMIT 0, 10";
>
> but where told that the ` was not required
>
> $sql = "SELECT * FROM hyperlinks ORDER BY clicks DESC LIMIT 0, 10";
>
> Any Comments on this?

Yes, this should be posted to php-db.

For simple cases ` ` are not needed. It is only used if your column names 
contain weird characters, spaces for instance, then:

SELECT `First Name` FROM Address;


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
        A domineering man married a mere wisp of a girl.  He came back from
his honeymoon a chastened man.  He'd become aware of the will of the wisp.
*/
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> On Saturday 16 March 2002 13:08, Philip J. Newman wrote:
> > A few of us folk at PhilipNZ.com would like to know about using " and ' or
> > ` in My Sql when calling information from the database.
> >
> > we have always used
> >
> > $sql = "SELECT * FROM `hyperlinks` ORDER BY `clicks` DESC LIMIT 0, 10";
> >
> > but where told that the ` was not required
> >
> > $sql = "SELECT * FROM hyperlinks ORDER BY clicks DESC LIMIT 0, 10";
> >
> > Any Comments on this?
> 
> Yes, this should be posted to php-db.
> 
> For simple cases ` ` are not needed. It is only used if your column names 
> contain weird characters, spaces for instance, then:
> 
> SELECT `First Name` FROM Address;

 
And of course single quotes (') should be used to delimit text data being 
inserted into CHAR type fields. But you knew that, of course.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
On Sat, 16 Mar 2002, Philip J. Newman wrote:
> A few of us folk at PhilipNZ.com would like to know about using " and ' or ` in My 
>Sql when calling information from the database.
> 
> we have always used
> 
> $sql = "SELECT * FROM `hyperlinks` ORDER BY `clicks` DESC LIMIT 0, 10";
> 
> but where told that the ` was not required
> 
> $sql = "SELECT * FROM hyperlinks ORDER BY clicks DESC LIMIT 0, 10";

The backtick (`) has an entirely different meaning and shouldn't be used 
to delimit arguments in MYSQL statements.

It's used to indicate that you want to execute a command external to PHP 
(for instance, `/bin/ls`).

The standard quote (') should be used to delimit string literals in MYSQL
statements. Use it to surround strings you're inserting into or comparing 
against VARCHARs, CHARs, TEXTs, etc.

Both are unnecessary in the statements you cite above. Here's a simple 
statement using the standard single quote:

   $sql = "UPDATE mytable SET name='Best Table Of All' WHERE id=3";

miguel

--- End Message ---
--- Begin Message ---
Hi!
I wonder if this script can be written in PHP?
I know nothing about asp.

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Set SecureLink = Server.CreateObject("SecureLinkActiveX.SecureCnx.1")
Set Application("SecureLink") = SecureLink
SecureLink.SetTransacServer "specifiedserver.com", 443, 80
SecureLink.SetContentServer "www.webshop.com", 80,"/webshop/"
SecureLink.SetKeyFileName "c:/programs/securelink/secrets/flat_o.kf"
SecureLink.SetOfrFileName "c:/programs/securelink/osl40.ofr"
SecureLink.SetApplStoreID "000000"
SecureLink.SetApplMiofferName "shopingcart"
End sub
</SCRIPT>

--
Regards,
Jan Grafström

Sweden

Bredsäter 2091
87010 Älandsbro


--- End Message ---
--- Begin Message ---
Hi,

I'm having difficulty getting a php page to reload when the user goes back
to it. The page is initially loaded with no variables passed, but is then
reloaded with variables passed with GET and also retrieves variables from a
session cookie, which is set by a different page on first load.

This works fine, but the problem is, when the user goes back to the first
page (via history) the page does not reload and it fails to receive the
cookie data even though it receives it every other time it loads. So
basically I can only get the cached version. I have tried the following at
the start of the document:

    session_cache_limiter('must-revalidate');

// and this:

    session_cache_limiter('nocache');

// and this:

    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");

and a few combinations. I am testing with IE 5.5 with all default settings.
I am using PHP 4.1.1

Thanks.

Peter



--- End Message ---
--- Begin Message ---
... i think you might have to create the
$date directory before writing a file to it.

writing to /tmp/dir/file.txt will fail if
the directory "dir" doesn't exist.


jtjohnston wrote:
> Does anyone have time to run this code?
> This is definitely weird. Either a Windows or a code problem. If I set:
> 
> $to_path = "c:\\ccl_www\\".$date."ccl_www\\";
> 
> to:
> 
> $to_path = "c:\\ccl_www\\".$date."\\ccl_www\\";
> (I add \\)
> 
> It fails to create c:\ccl_www\20020315\ccl_www, but otherwise will
> create c:\ccl_www\20020315ccl_www
> 
> I've tried debugging this thing backwards, but have not found my
> problem.
> 
> If for example, I tried creating manually:
> 
> c:\ccl_www
> 
> thinking it was a root thing. It worked, then it didn't.
> 
> :x( John
> P.S. By the by, I tried this on a Unix box, and thought it worked, but
> then it didn't when I went back to it this morning. I'm confused!
> 
> 
> ------------snip------------
> $date = date ("MD");
> #######################################
> ###  Don't forget trailing slash  #####
> #######################################
> $from_path = "c:\\program files\\easyphp\\ccl_www\\";
> $to_path = "c:\\ccl_www\\".$date."ccl_www\\";
> #######################################
> 
> if(!is_dir($from_path))
> {
> echo "failed";
> exit;
> }else{
> rec_copy($from_path, $to_path);
> echo "files copies from $from_path and backed up to $to_path";
> }
> 
> #########################################################################
> 
> function rec_copy ($from_path, $to_path) {
> if(!is_dir($to_path))
> mkdir($to_path, 0777);
> 
> $this_path = getcwd();
>  if (is_dir($from_path))
>  {
>     chdir($from_path);
>     $handle=opendir('.');
> 
>     while (($file = readdir($handle))!==false)
>     {
>  if (($file != ".") && ($file != "..")) {
>   if (is_dir($file))
>   {
>   rec_copy ($from_path.$file."/",  $to_path.$file."/");
>        chdir($from_path);
>   }else{
> #  echo "error if (is_dir($file))<br>";
>   }
>   if (is_file($file))
>   {
>   copy($from_path.$file, $to_path.$file);
>   }else{
> #  echo "error copy($from_path.$file, $to_path.$file)<br>";
>   }
>  }#end (($file != ".")
>     }#end while (($file
> 
>     closedir($handle);
>  }# end if (is_dir
>  else{
> # echo "if (is_dir($from_path))<br>";
>  }
> }# end function
> 
> 
> 
> 
> 



--- End Message ---
--- Begin Message ---
Is there a MySQL function that I can use to increment the integer value of a row entry 
with one query?

Here's the combined PHP and SQL in psuedo code form...
UPDATE mytable SET myval++

Something like that.  So I dont have to pull the value from the database, increment 
it, then post it back to the database.  Any help will be greatly appreciated,

-Keivn
--- End Message ---
--- Begin Message ---
On Sat, 16 Mar 2002, Kevin Stone wrote:
> Is there a MySQL function that I can use to increment the integer value of a row 
>entry with one query?
> 
> Here's the combined PHP and SQL in psuedo code form...
> UPDATE mytable SET myval++
> 
> Something like that.  So I dont have to pull the value from the database, increment 
>it, then post it back to the database.  Any help will be greatly appreciated,

   UPDATE mytable SET myval=myval+1
 
miguel

--- End Message ---
--- Begin Message ---
*LOL*  I didn't think it would be that simple.. but yup.. it works.  Maybe I
should test these things out before I open my stupid mouth.  Thanks.
-Kevin

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Kevin Stone" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 2:02 AM
Subject: Re: [PHP] Increment a value in a MySQL database with one query?


> On Sat, 16 Mar 2002, Kevin Stone wrote:
> > Is there a MySQL function that I can use to increment the integer value
of a row entry with one query?
> >
> > Here's the combined PHP and SQL in psuedo code form...
> > UPDATE mytable SET myval++
> >
> > Something like that.  So I dont have to pull the value from the
database, increment it, then post it back to the database.  Any help will be
greatly appreciated,
>
>    UPDATE mytable SET myval=myval+1
>
> miguel
>

--- End Message ---
--- Begin Message ---
Hi,

I'm trying to resize images from a big image to smaller image in
dimension and also file size so that when a user upload an image into
server, when a browser display the picture it desn't have to be as big.
I hope my question make sense.

I just don't know where to start.

may be somebody could help me, please.

thank you for reviewing my email.

regards,
Dani

--- End Message ---
--- Begin Message ---
Hi Dani,

> I'm trying to resize images from a big image to smaller image in
> dimension and also file size so that when a user upload an image into
> server, when a browser display the picture it desn't have to be as big.
> I hope my question make sense.

    a good way for working with images is using the gd-library. Just look at
http://www.boutell.com/gd/. Ther's a possibility to download the extension
and there are some introductions too.

I hope this helps

Bye, Marcel

--
registered Fli4l-User #00000388


--- End Message ---
--- Begin Message ---
firstly, apologies for the cross post, but I urgently need a Windows 98 /
PHP / PWS environment to test an issue on.

if anyone could help out with that, please email me back directly.

Thanks,

James

--
James Cox :: [EMAIL PROTECTED] :: Landonize It! http://landonize.it/
Was I helpful?  http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/

--- End Message ---
--- Begin Message ---
James,

Firstly I have a suggestion for you, I downloaded a copy of something
called VMWare, it allows you to install virtual machines, ie, depending
on your disk space you can run mutliple operating systems without multi
boot. It even has the ability to forget changes, so you can have a
stable build, and 'try' software on it - great for perfecting software
installation and so on.

It runs on windows and linux

Im not affiliated but it's a rocking product.  I don't however, curretly
have a Win98 setup on it, I have every other stupid form of windows bar
the 98/me/95 variety

They do a 30day eval version no other restrictions, its nice.

> -----Original Message-----
> From: James Cox [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, March 16, 2002 2:04 PM
> To: Php-Qa
> Cc: php-general; Php-Dev
> Subject: [PHP-QA] QA help needed
> 
> 
> firstly, apologies for the cross post, but I urgently need a 
> Windows 98 / PHP / PWS environment to test an issue on.
> 
> if anyone could help out with that, please email me back directly.
> 
> Thanks,
> 
> James
> 
> --
> James Cox :: [EMAIL PROTECTED] :: Landonize It! 
> http://landonize.it/ Was I helpful?  
http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/


-- 
PHP Quality Assurance Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I wonder whether this is possible? 

I would like to format a text input so that the first letter of the input (as 
the user is typing it in) would automatically be converted to Uppercase 
(capitals). Furthermore, if it is possible, I would like to pre-format the 
date "input type=text" so that only numbers or dashes could be entered. I 
really enjoyted this capablity in Paradox PAL language. 

Does anything exist that would allow me to do this in PHP?

An example:

Code
<td><b>Surname</b></td>
<td><input type=text name=rap></td>

Screen (and into database)
Surname: black   >> would be converted as they type to >> Surname: Black

Any suggestions or advice would be greatly appreciated.
Tia,
Andre


-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.

May God bless you abundantly in His love!

For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/
--- End Message ---
--- Begin Message ---
        Hello all:

        I am playing with sessions and I have a problem with the
session_destroy() function. If I do a session_register() after calling it,
the session recover the previous values (values that I supposed forgot by
the session).

        At
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
have the web page and the code, respectively.

        The problem is that the "counter" variable maintains the value
even after click "logout".

        If you go to the web page, press:

login -> counter=0
other link -> counter=1
other link -> counter=2
other link -> counter=3
logout
other link -> counter=4

        I suppose that the problem is that I call
session_register("counter"). How must I solve this problem?

        Best regards and thanks in advance,
                Carlos.

        [ all about php+web : http://www.improveyourweb.com ]

 _______Carlos Costa Portela_________________________________________________
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_____Tódalas persoas maiores foron nenos antes, pero poucas se lembran______|

--- End Message ---
--- Begin Message ---
Hi

If I try to open a non-existing PHP document by my Apache server I got an
internal server error massage. All other documents that were not found bring
me to a error 404 document.
4 days ago I updated from PHP3 to PHP4.0.3pl1 and with the former version i
got a error massage like: "no php file input spicified on line 0" or
something like that.

Does anybody no about this problem? Thank you
Jan


--- End Message ---
--- Begin Message ---
Hello,

I have installed php 4.1.2. as a cgi module.
But http_cookie isn't set. I don' know whats wrong.
You can find the output of phpinfo() at
http://www.tgp2stats.com/test.php

Tnx,

Bas Jobsen
--- End Message ---
--- Begin Message ---
Would a 10kb file which has 5kb of comments take longer to process in php
than the same file wihout the comments which is 5kb?

Or are the comments ignored as far as server load and speed to delivery are
concerned?

--- End Message ---

Reply via email to