I am currently working on displaying some arrays using PHP and MySQL.
The simplified code looks like this:
$ sql = "select from the program"; $ Result = mysqli_query ($ dbc3, $ sql); $ Tryout_reports = array (); While ($ line = mysqli_fetch_assoc ($ result)) {$ tryout_reports [] = $ line ['file_name'] "
"; } $ Detail_report ['tryout_reports'] = $ tryout_reports;
I have extracted a lot from SQL, so if there is something wrong with it, please do not pay attention. SQL statement works fine.
The problem is that each value is being output from comma separated, and it looks really bad.
When the run is running, the HTML looks like this:
File 1.pdf & lt; Br> "," File 2.pdf & lt; Br> "," e.t.c. Now, I have seen a bit and I have tried the following:
ltrim () rtrim () explosion (str_replace) Code> I know that rtrim works, but it does not remove the comma, I tried to do something like this:
$ tryout_reports [] = rtrim ( $ Line ['file_name'], "pdf");
And it took the PDF out of the end of every one, but when I replace "pdf" with "", then it does nothing.
Actually stuck,
EDIT: Forgot to add, this page that uses this data and displays on the page is in it:
table.append ("<< tr> Tryout Reports " + Data [0]. Tryout_reports + "& lt; / td> & lt; / tr & gt;"); This is inside a jQuery function which clicks the job number to display additional information. This comma comes from javascript because you directly parse the array, you may join: w3schools .com / jsref / jsref_join.asp
Popular posts from this blog
Using a form submission on an embedded iframe , the customer downloads a compressed log file Requested. The request was sent to the server, which is the compressed log files, perform some database operations and returns a compressed file. After just 2 minutes, 504 gateway time-out server did not respond timely message on browser net panel How to fix this error? The log files were taking a long time to compress, and timeout was set to 2min The error was fixed by extending the file file: # # timeout: The number of seconds before getting the time out. # # # Timeout 120 timeout 600
We have a working ASP.NET Web API REST service, which is one of the methods of our controller, HTTPTTEX. .) Socket handler code looks something like this ... Public async task socket handler (AspNetWebSocketContext context) {_webSocket = context.WebSocket; ... while (! Cts.IsCancellationRequested) {WebSocketReceiveResult Results = _webSocket.ReceiveAsync (Input Segment, cts.Token) .Result; WebSocketsStateCollusocketState = _webSocket.State; If (result.MessageType == WebSocketMessageType.Close || currentSocketState == WebSocketState.CloseReceived) {// What should I use. CloseAysnc () or. CloseOutputAsync ()? _webSocket.CloseOutputAsync (WebSocketCloseStatus.NormalClosure, "Client Requested", cts.Token). Wait (); } If (currentSocketState == WebSocketState.Open) {...}}} .What is the difference between .CooseAsync () and CloseOutputAysnc ()? I tried both of them and they both seemed to work fine but some difference should be the same they both describe very similar to...
I am trying to apply a stylesheet for QGroupBox (QT4.8), which works on the normal screen ( 96 dpi) high resolution screen (Yoga 2 Pro, 3200x1800, 275 dpi, windows 8.1). The following style looks good on the 275 dpi screen, but the top margins on a regular 96 dpi screen are far too big. QGroupBox {border: 1px solid red; Range radius: 7px; Margin-top: 12x; } QGroupBox :: Title {subcontrol-origin: margin; Subcontrol-position: left above; Padding-left: 10px; Padding-right: 10px; } Changing the top-margin has an effect, but I did not get a proper setting which works on both screens. If I shorten the value, the content of the group box overlaps with the title on 275 dpi screen. I was also playing with units "East", "PX", "MX", "PT". Reading the document I would have guessed, "2 X" was the correct solution, which should be scaled with different screen resolutions. Without the stylesheet, the groupbox works well on both screens. ...
|
Comments
Post a Comment