You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I have entered a pipe symbol, |, into a database field.
When I try to call that field, the pipe symbol gets changed to a space.
I commented it out in database.pl but that doesn't help.
Yes, the pipe is in the database field.
Where is the pipe being converted to a space?
I'm using ...
$sql_statement = "
SELECT optionsel_id,optionsel_selname
FROM optionsel
WHERE optionsel_option=$dbins_id
";
Then, ...
@optionsel = database_call('optionsel','SELECT',$sql_statement);
Right after this database_call, the pipe is changed to a space.
Last edited by Blitzen (04-15-2009 11:35:42)
Offline
I'm the wrong person to answer 5.1 questions but I find 3 instances of the vertical bar being changed to a space in database.pl. Perhaps the one you changed wasn't the correct one. It is worth mentioning that allowing vertical bars is a little dangerous since that's the pipe character which is why it gets changed.
Offline
At the risk of sounding overly simplistic, it has to be somewhere else (that you didn't comment out) in database.pl or ste_prod.pl. As far as I know MySQL would let you have the pipe, so CCP must be converting it... and those two places would be the only bits of code associated with your code snippet. CCP does use pipes in the options hidden fields, so it is distinctly possible that ste_prod.pl is removing it as it is preparing to use it in the option code.
Offline
Dave,
Yes, I commented it out in three places and quickly tested. It didn't work so I put it back as the original was programmed. I cleared my browser cache before re-testing.
Rachel,
It's not removed in those files.
Like my test showed, the pipe is converted to a space immediately after it's called from the database - immediately after @optionsel = database_call('optionsel','SELECT',$sql_statement);
You can test it by entering this right after the "database_call" statement and reviewing the source code of that page.
print <<qq;
<!--
$optionsel[0][1]
-->
qq
I guess I'll have to use another character which is a bummer because now I have to reprogram and restructure the database entries that have the pipe.
Last edited by Blitzen (04-15-2009 12:23:23)
Offline
Might be something with the database compilation then... although I'm honestly not sure. Sorry, ya got me on this one. Although I will say that pipes in the product options are a bad idea for the reason I mentioned before anyway.
Offline
When I read that field with a generic php file, the pipe is there.
My conclusion is something in CCP5.1 is doing this.
Rachel, I appreciate your concern, but there's no problem because the field that's using it to delimit values in it is a new one. This field has nothing to do with the form elements. It's a long story.
My only question was where it was being removed, and apparently no one knows, so I'll change the delimited value to something else.
Offline
Blitzen wrote:
My conclusion is something in CCP5.1 is doing this.
As Rachael said, it may be the Perl database class that is doing it not specifically CCP though it's now moot.
Offline