MySQLTalk.org Forum Index MySQLTalk.org
MYSQL discussions groups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parens in VARCHAR fields

 
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> Eventum General Discussion
View previous topic :: View next topic  
Author Message
Barry Benowitz
Guest





PostPosted: Wed Apr 25, 2007 12:50 am    Post subject: Parens in VARCHAR fields Reply with quote



Hi,



In my eventum_project table some of my prj_title fields contain
parenthesis, ie KSX(G1). When I right a script using the method
Project::getID( ) I can never get a match and I figure it must be
because of the parenthesis there. For example Project::GetID('KSX(G1)");
doesn't give me the expected return. How can I get the ID back when the
prj_title contains parentheses.



Barry
Back to top
Bryan Alsdorf
Guest





PostPosted: Wed Apr 25, 2007 1:31 am    Post subject: Re: Parens in VARCHAR fields Reply with quote



Hi Barry,

Barry Benowitz wrote:
Quote:
Hi,

In my eventum_project table some of my prj_title fields contain
parenthesis, ie KSX(G1). When I right a script using the method
Project::getID( ) I can never get a match and I figure it must be
because of the parenthesis there. For example Project::GetID('KSX(G1)");
doesn't give me the expected return. How can I get the ID back when the
prj_title contains parentheses.

I have been unable to reproduce this.

var_dump(Project::getID('KSX(G1)'));

That returns an ID for me.

Best Regards,
/bryan
Back to top
Barry Benowitz
Guest





PostPosted: Wed Apr 25, 2007 4:53 am    Post subject: RE: Parens in VARCHAR fields Reply with quote



That works for me, too :)

This doesn't:
$myp="KSX(G1)";
var_dump(Project::getID('$myp'));

So whats the diff?

Thanks for your help!

Barry

-----Original Message-----
From: Bryan Alsdorf [mailto:bryan (AT) mysql (DOT) com]
Sent: Tuesday, April 24, 2007 4:32 PM
To: Barry Benowitz
Cc: Eventum User List
Subject: Re: Parens in VARCHAR fields

Hi Barry,

Barry Benowitz wrote:
Quote:
Hi,

In my eventum_project table some of my prj_title fields contain
parenthesis, ie KSX(G1). When I right a script using the method
Project::getID( ) I can never get a match and I figure it must be
because of the parenthesis there. For example
Project::GetID('KSX(G1)");
doesn't give me the expected return. How can I get the ID back when
the
prj_title contains parentheses.

I have been unable to reproduce this.

var_dump(Project::getID('KSX(G1)'));

That returns an ID for me.

Best Regards,
/bryan
Back to top
Bryan Alsdorf
Guest





PostPosted: Wed Apr 25, 2007 6:16 am    Post subject: Re: Parens in VARCHAR fields Reply with quote

Hi Barry,

Barry Benowitz wrote:
Quote:
That works for me, too :)

This doesn't:
$myp="KSX(G1)";
var_dump(Project::getID('$myp'));

So whats the diff?

In PHP if you use single quotes to surround a string variables are not
evaluated, for example:

$var = 'foo';
echo "blah: $var"; // prints blah: foo
echo 'blah: $var'; // prints blah: $var

So your code is literally looking for a project named $myp.

/bryan

Quote:
Thanks for your help!

Barry

-----Original Message-----
From: Bryan Alsdorf [mailto:bryan (AT) mysql (DOT) com]
Sent: Tuesday, April 24, 2007 4:32 PM
To: Barry Benowitz
Cc: Eventum User List
Subject: Re: Parens in VARCHAR fields

Hi Barry,

Barry Benowitz wrote:
Hi,

In my eventum_project table some of my prj_title fields contain
parenthesis, ie KSX(G1). When I right a script using the method
Project::getID( ) I can never get a match and I figure it must be
because of the parenthesis there. For example
Project::GetID('KSX(G1)");
doesn't give me the expected return. How can I get the ID back when
the
prj_title contains parentheses.

I have been unable to reproduce this.

var_dump(Project::getID('KSX(G1)'));

That returns an ID for me.

Best Regards,
/bryan

--
Bryan Alsdorf, Manager of Support Systems
MySQL AB, www.mysql.com
MySQL Conference & Expo - http://www.mysqlconf.com/
April 23-26 in Santa Clara, California (US)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> Eventum General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.