4 messages in com.mysql.lists.eventum-usersRe: Parens in VARCHAR fields| From | Sent On | Attachments |
|---|---|---|
| Barry Benowitz | 24 Apr 2007 12:49 | |
| Bryan Alsdorf | 24 Apr 2007 13:31 | |
| Barry Benowitz | 24 Apr 2007 16:52 | |
| Bryan Alsdorf | 24 Apr 2007 18:15 |
| Subject: | Re: Parens in VARCHAR fields![]() |
|---|---|
| From: | Bryan Alsdorf (bry...@mysql.com) |
| Date: | 04/24/2007 06:15:57 PM |
| List: | com.mysql.lists.eventum-users |
Hi Barry,
Barry Benowitz wrote:
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
Thanks for your help!
Barry
-----Original Message----- From: Bryan Alsdorf [mailto:bry...@mysql.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)




