This topic is locked
[SOLVED]

Keep extra spaces from query result in web page output

8/17/2021 11:48:07 AM
PHPRunner General questions
S
seedavidwork author

I have a query that CONCAT's three fields in my table to a single alias coulmn in my query result. I have added SPACE(3) between the fields so the results will format nicer on the screen. When I look at he Query Reusts in PHPRunner Application I see the three spaces as expected, but when I view the page in the published web appication the extra spaces are removed.

Is there a way to show the query output with the extra spaces on the web view?

S
seedavidwork author 8/17/2021

A friend suggested I add "&nb sp;&nb sp;&nb sp;" (I added space between b and s so it will display in the browser ) in my query where I had SPACE(3) and it worked to solve the web output. The query now shows the &nb sp; characters but the web output is correct.

admin 8/17/2021

Web browsers will compact multiple space characters into a single one so this is not a proper method to format your output.

  1. What version of PHPRunner is this?
  2. Show us some screenshots that would explain what kind of layout you trying to achieve and how it looks now.

HJB 8/17/2021

Yellow marked code line within the screenshot below refers to the correct
CONCAT related MySQL syntax for SPACE insertion between two fields.

img alt

S
seedavidwork author 8/17/2021

This project is in version 9.8

The output I was looking for is like this
img alt
and I was able to do this with the & n b s p ; ( it was skipped by the browser in my previous message )
Query

img alt
SQL Result

img alt

Previously I had

img alt

but as I mentioend the extra spaces are stripped ( aparently by the browser )