Re: [PHP-DB] String manipulation

2009-09-11 Thread olavi
You can do like this: $str = 'helloworld'; echo preg_replace('//', ' ', $str); this will print out -> h e l l o w o r l d Olavi Ivask > How would I put a space after each letter: > > echo str_shuffle(stripslashes(mysql_result($word_result,0,"word")); > > Ron -- PHP Database Mailing List (

Re: [PHP-DB] String manipulation

2009-09-11 Thread boclair
Ron Piggott wrote: How would I put a space after each letter: echo str_shuffle(stripslashes(mysql_result($word_result,0,"word")); Ron CSS best handles styling E.G. OR $word_result"; ?> Increase the em value to customize the spacing Louise -- PHP Database Mailing List (http://w

Re: [PHP-DB] String comparision issue with change of databases

2007-11-24 Thread $P$ $T$
On Nov 23, 2007 5:42 PM, Stut <[EMAIL PROTECTED]> wrote: > Tamkhane, Pravin wrote: > > Hi All, > > I am trying to write a simple user verification(not using MD5 hash) . I > > have users table in database which contains login_id and passwd for > > registered users. I am using PDO for this purpose. I

Re: [PHP-DB] String comparision issue with change of databases

2007-11-23 Thread Stut
Tamkhane, Pravin wrote: Hi All, I am trying to write a simple user verification(not using MD5 hash) . I have users table in database which contains login_id and passwd for registered users. I am using PDO for this purpose. If i use MySQL database, following code for user verification works wel

RE: [PHP-DB] String manipulation

2005-05-02 Thread Bastien Koert
Are you trying to achieve this in the db or for the application? It sounds like the application, in which case I would get the string from the db and then use substr to pull out the various elements. $first_name = substr($rows['name'],0,1); $last_name = substr($rows['name'],1); Bastien From: "Ch

RE: [PHP-DB] String pictures in MySQL

2005-03-18 Thread Bastien Koert
examples of how to get them into the db (use a blob field) http://www.weberdev.com/get_example-4063.html and get the out http://www.weberdev.com/get_example-4062.html bastien From: Bunmi AKinmboni <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] String pictures in MySQL Date: Fri, 18

Re: [PHP-DB] String Parsing/Escaping

2005-01-09 Thread Alexander Mueller
Jochem Maas wrote: hi Alexander, interesting question regarding 'safety' v. readability v. speed - I'm sure you'll get different views depending on who you ask. Here is my take: Thank you Jochem! :) I rate speed as the least important issue - you can alway use a faster machine, get some more RAM

Re: [PHP-DB] String Parsing/Escaping

2005-01-09 Thread Jochem Maas
hi Alexander, interesting question regarding 'safety' v. readability v. speed - I'm sure you'll get different views depending on who you ask. Here is my take: Alexander Mueller wrote: Hi, below are three versions of an SQL call along with escaping the passed value. > $value=mysql_escape_string

Re: [PHP-DB] String question

2004-12-14 Thread Jochem Maas
Chris Payne wrote: Hi there everyone, I am having to read a string with text in, but the way the DB is written in the same string you have the price, for exampleā€¯ this doesn't sound like a DB problem, sounds more like a regexp problem. (i.e. php-db is probably the wrong list) CASARON 4G 50lb

RE: [PHP-DB] String handling

2004-09-30 Thread Darryl
Darryl'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] String handling If you use the value from a text box in a mathematical equation or comparison, PHP will automatically attempt to handle it as an integer or some other numeric type (e.g., float). So if you did something like: if($_POST["myvar

RE: [PHP-DB] String handling

2004-09-30 Thread Hutchins, Richard
If you use the value from a text box in a mathematical equation or comparison, PHP will automatically attempt to handle it as an integer or some other numeric type (e.g., float). So if you did something like: if($_POST["myvar"] < 1){ ... } PHP would handle $_POST["myvar"] as an integer aut

Re: [PHP-DB] String handling

2004-09-30 Thread Joseph Crawford
$string = '10001'; if((int)$string) > 1) { echo 'Yep it is'; } -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROTECTED] 802-558-5247 For a GMail account contact me OFF-LIST -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] string

2002-10-31 Thread John Coder
Didn't even think of looking for a mysql function to accomplish this. Thanks. On Thu, 2002-10-31 at 20:52, Beau Lebens wrote: > you can do this as a part of your db query > > check the string functions available for your rdbms. > > mysql would use something like; > > SELECT SUBSTRING(monthnam

RE: [PHP-DB] string

2002-10-31 Thread John W. Holmes
DATE_FORMAT(your_column,'%b') or SUBSTRING() ---John Holmes... > -Original Message- > From: John Coder [mailto:jcoder@;insightbb.com] > Sent: Thursday, October 31, 2002 8:47 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] string > > I want to list months found in db by the first three let

RE: [PHP-DB] string

2002-10-31 Thread Beau Lebens
you can do this as a part of your db query check the string functions available for your rdbms. mysql would use something like; SELECT SUBSTRING(monthname(blah), 0, 3) AS monthAbbrev FROM tablename from memory HTH beau // -Original Message- // From: John Coder [mailto:jcoder@;insight

RE: [PHP-DB] string concatenattion

2002-09-23 Thread M . A . Bond
The line $str= buffer[$i]; Should probably read: $str .= buffer[$i]; Mark -Original Message- From: roslyn jose [mailto:[EMAIL PROTECTED]] Sent: 23 September 2002 11:39 To: [EMAIL PROTECTED] Subject: [PHP-DB] string concatenattion hi, i have an array of strings and would like to c

Re: [PHP-DB] string

2002-07-21 Thread bo
Hi, .: B i g D o g :. Thank you, indeed right after I post my question, I was able to use strpos and substr functions to solve my problem. But yours is even simpler with only one function, cheers. Thanks a lot. Sincerely Bo "Ray Hunter" <[EMAIL PROTECTED]> ??:01a901c23108$8a881a30$[EMAIL P

Re: [PHP-DB] string

2002-07-21 Thread Ray Hunter
list( name, rest ) = explode( '@', $email ); name = everything before the @ rest = everything after @ .: B i g D o g :. - Original Message - From: "bo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, July 21, 2002 4:42 PM Subject: [PHP-DB] string > Hi, > > for any email

Re: [PHP-DB] String datetime to DateTime

2002-06-20 Thread Glenn Holden
their %s (yes that was a typo) looks for a space > as a delimiter and not the specified next one. > > Easiest workarounds off the cuff... > 1) sscanf() to get the bulk of the data out, then regex out the %s string. > 2) eregi_replace() Jun with the numeric > 3) Dump it as numeric

Re: [PHP-DB] String datetime to DateTime

2002-06-20 Thread szii
instead of a string month name 4) eregi_replace() the /'s with spaces then sscanf() it. 'Luck -Mike - Original Message - From: "Glenn Holden" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 20, 2002 8:48 AM Subject: Re: [PHP-DB] String dat

Re: [PHP-DB] string

2002-05-17 Thread Jeremy Peterson
Sure- $test = "text1"; if(substr($test, -1) == 1){ print "do something"; } else{ print "didn't equal 1 "; At 08:00 AM 5/17/2002 -0400, Natividad Castro wrote: >Hi to all, >how can I evaluate a variable? >For example >$test = "test1"; >then I want to evaluate if $test contains

RE: [PHP-DB] string compare function

2002-01-17 Thread matt stewart
by the way, what are you actually trying to do with the code? there may be a different way of doing it which isn't so confusing? -Original Message- From: tomhilton [mailto:[EMAIL PROTECTED]] Sent: 17 January 2002 15:20 To: [EMAIL PROTECTED] Subject: [PHP-DB] string compare function Hi,

RE: [PHP-DB] string compare function

2002-01-17 Thread matt stewart
take it you've tried having exactly the same value for each to test if the return is 0? it shouldn't be comparing literals, but it looks like it could well be! try putting "" round the variables, and various things like that? -Original Message- From: tomhilton [mailto:[EMAIL PROTECTED]]

RE: [PHP-DB] string compare function

2002-01-17 Thread matt stewart
post the entire line of code, (and the surrounding couple of lines?? and we'll get more of an idea. -Original Message- From: tomhilton [mailto:[EMAIL PROTECTED]] Sent: 17 January 2002 14:56 To: [EMAIL PROTECTED] Subject: [PHP-DB] string compare function Hi, I'm having a problem with the

RE: [PHP-DB] string problem

2001-09-14 Thread Justin Buist
There's an option in php.ini: magic_quotes_gpc = On/Off; If on, any GET, POST, and Cookie data will come back with \ marks before ' and " marks. Guesing one server has it set to Off, and one set to On. Justin Buist Trident Technology, Inc. 4700 60th St. SW, Suite 102 Grand Rapids, MI 49512 Ph

RE: [PHP-DB] string problem

2001-09-14 Thread Rick Emery
Don't know why you're getting problem. However, you can use stripslashes() to avoid the problem. -Original Message- From: Bruno Franx [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 10:04 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] string problem scenario: Win.nt 4.0 pach6a