php-windows Digest 7 Mar 2002 05:38:19 -0000 Issue 1033

Topics (messages 12491 through 12498):

sprintf
        12491 by: Scott St. John
        12492 by: Mike Flynn
        12495 by: Scott St. John

Formatting 'body' using mailto: command
        12493 by: Mick
        12494 by: Matt Hillebrand

prob with imagestring
        12496 by: Carl L.

Re: mail() and no internet connection
        12497 by: Steve Yates

Re: MySQL auto_increment ??
        12498 by: Steve Yates

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 ---
I am trying to create a file in which each line is exactly 255 characters 
long, some of the data I am importing is longer than the field allows.  
Does anyone know of a way to strip that data off at x character?  Example,
I have a 3 character field and the value being inserted into it is scott, 
I would only display sco

Thanks,

-Scott


-- 


--- End Message ---
--- Begin Message ---
One option is to use substr():

$thestring = 'scott';
$thestring = substr($thestring, 0, 3);

At 03:02 PM 3/6/02 -0500, Scott St. John wrote:
>I am trying to create a file in which each line is exactly 255 characters
>long, some of the data I am importing is longer than the field allows.
>Does anyone know of a way to strip that data off at x character?  Example,
>I have a 3 character field and the value being inserted into it is scott,
>I would only display sco
>
>Thanks,
>
>-Scott

--- End Message ---
--- Begin Message ---
Mike:

Yeah (hitting head on wall), that will work!  Thank you.

-Scott




On Wed, 6 Mar 2002, Mike Flynn wrote:

> One option is to use substr():
> 
> $thestring = 'scott';
> $thestring = substr($thestring, 0, 3);
> 
> At 03:02 PM 3/6/02 -0500, Scott St. John wrote:
> >I am trying to create a file in which each line is exactly 255 characters
> >long, some of the data I am importing is longer than the field allows.
> >Does anyone know of a way to strip that data off at x character?  Example,
> >I have a 3 character field and the value being inserted into it is scott,
> >I would only display sco
> >
> >Thanks,
> >
> >-Scott
> 

-- 


--- End Message ---
--- Begin Message ---
Using the 'mailto:' command I'm trying to format a 'default' message
something like...
$msg_body =
"?subject=whatever&body=This%20is%20the%20default%20part%20of%20the%20message%20..."
and soon on but I want to force some 'newlines' into the resultant
message body but to no avail.
If I just put \n in the message it only reads up until the '\' and
nothing after (which is also why I have to use the '%20' for every space
in the string). If I put the hex '%5E%6E' it puts the \n literal in the
message.
Any suggestions? - besides using mail()!

--- End Message ---
--- Begin Message ---
I know that with mail() in Windows, you must use \r\n for each carriage
return line feed, so why don't you try this:

%5Cr%5Cn



Matt Hillebrand



-----Original Message-----
From: Mick [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 12:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Formatting 'body' using mailto: command


Using the 'mailto:' command I'm trying to format a 'default' message
something like...
$msg_body =
"?subject=whatever&body=This%20is%20the%20default%20part%20of%20the%20messag
e%20..."
and soon on but I want to force some 'newlines' into the resultant
message body but to no avail.
If I just put \n in the message it only reads up until the '\' and
nothing after (which is also why I have to use the '%20' for every space
in the string). If I put the hex '%5E%6E' it puts the \n literal in the
message.
Any suggestions? - besides using mail()!


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
Whene i create images with `ê` and  `è` , I get  `ë`
anyone can help me please

--- End Message ---
--- Begin Message ---
"Kenneth Brill" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If I issue a mail() command but there is no live internet connection,
what
> happens?  Will the mail be sent when there is a connection?

    Are you running your own mail server?  If so then you can set it to
work that way.  If you have PHP pointed to your ISP's mail server then
it won't connect.

    If you need a mail server, Mercury is free and not too difficult to
set up (www.pmail.com).

 - Steve Yates
 - After they make styrofoam, what do they ship it in?

/ Taglines by Taglinator - www.srtware.com /




--- End Message ---
--- Begin Message ---
"Sviss Cobazor" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Now I want to delete user with ID = 2.
> Now I create a new user, he will get ID = 4.
>
> How can i reuse the ID 2 for creation of new users?

    I am not familiar with MySQL specifically but in my database
experience you cannot reuse an auto-increment number.  One approach I
have taken in the past is to have my own table with a number field(s)
and manually increment it, then use that in the other tables.  I suppose
you could scan for unused numbers but this seems quite time consuming.
You just have to be aware of locking other write requests so no two try
to share a number.

> Another thing:
> If ID is INT(3), what will happen when I insert user no. 1000?

    Most databases I've seen make an autoincrement field a longint.

 - Steve Yates
 - Gone crazy, be back later.  Please leave a message.  <Beep!>

/ Taglines by Taglinator - www.srtware.com /



--- End Message ---

Reply via email to