This topic is locked

Primary key problem by using concat

5/8/2008 1:17:33 AM
PHPRunner General questions
R
rockrockers23 author

Problem : Primary key is not just the result of _concat(subscriber.AccountNum,' : ', subscriber.Name)

this is the code on look up table selection...

concat(subscriber.Account_Num,' : ', subscriber.Name)
this event is during beforeAdd event process....so that i can check first if the account already existed....

.... "Select * FROM Subscriber Where Account_Num='".$values["Account_Num"]."'"
i am not new to phprunner but i just wondering why during my mysql query the result of the above drop down menu code is the whole concatenated value.. EX RESULT : 00001 : MYNAME that makes the result to nothing

How can i get only the subscriber's account number only that can be use in $values["Account_Num"] for my query../??

J
Jane 5/8/2008

Hi,
it's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

R
rockrockers23 author 5/8/2008

ok thnks.. i already found an alternative solution for my problem.... i just use the explode() function so that i can get the concatenated value from : concat(subscriber.Account_Num,' : ', subscriber.Name)

sample Code : solution from the problem of LOOKUP table on beforeAdd event...

$accountNumToBeExploded= $values["Account_Num"];

$accountNumberExploded= explode(" : ",$accountNumToBeExploded);

$accountNumTrimmed=trim($accountNumberExploded[0]);


.....these works the same with my actual code i just renamed the variable...