Ouput Formatting...
I would like to have the results of my query display in a grid format. The code below returns my thumbnails and links them to the actual images. However the entries in the database are simply paths to these images. I thought I could do this with CSS but the way this query is returning the results I am stuck and not sure how to resolve it. Any suggestions?
View Complete Forum Thread with Replies
Related Forum Messages:
Select And Ouput
I'm trying to display a bunch of pictures in rows with 5 pictures per row. The filenames of the pictures are all stored in a MySQL database and the actual files are stored on the server. So, I know how to return and output all of the records from a MySQL table using a while statement. However, I need to only output five of them, insert a break in the HTML to start a new line, and then output five more and another break, and then do it again until there are no more pictures left. Anyone have any ideas?
View Replies !
Ouput Image
I am trying to output an image with text coming from a database" $image=mysql_result($result,$i,"image"); trying to output it like this: <img src=../prod_images/" . $image . " height=90> problem is that some images have a space in the text like "image 1". When it is outputted onto the screen, the browser does not read anything after the space. How can I get around this?
View Replies !
How To Ouput A Html Page To PDF ?
I been able to output data from MySQL page and put in into a generated HTML page using <TABLE>. Is there any fastest way to convert the HTML page directly into a PDF document for the user to download when the user click on a link, juts like the one (PDF Version / Printable Version) of Devshed.com?
View Replies !
Mysql/PHP To Excel Ouput?
I can successfully, output contents from two mysql tables into excel but I was wondering if there was a way of determining the actual layout - column sizes because at present they are all over tha place? .....
View Replies !
I'm Getting Strange Ouput In Url String
I've been getting strange output in my url string within my app lately. It adds stuff like ?1174406969965 when I'm not even posting a url string on my forms. This doesn't seem like a big issue, but I was wondering if anyone has ran into this before. Code:
View Replies !
HTML Ouput Gets Scrambled While Parsing
On a page I want to display rows of recordset, coming from a mysql database. The problem is that somewhere halfway, PHP seems to generate messed up HTML code for no reason at all. e.g: The first 54 records display correct syntax. Code bellow is an examlpe of a row ouput for record 54 Code:
View Replies !
Sorting LDAP Ouput With PHP3
I am wanting to create a telephone list of all users on a LDAP database. I have managed to extract the data, but cannot get the code to sort the results in alphabetic order , based on surname. My code:
View Replies !
Formatting
Does anyone know how to keep the formating of a textarea box (i.e. keep the lines and spaces between lines) when it gets put into a mysql table (the column set as text).
View Replies !
Formatting A
I have some PHP: <?php $dir = "/"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo $file; echo "<br />"; } closedir($dh); } } ?> It checks all the files in a directory then list each file on a new line.Is there eny way of formatting each line for example the first line bg is grey the second is white the third is then grey and so on. How is this done?
View Replies !
Formatting Of Dates From MDB With PHP
I am having a problem with Date formatting I am running PHP on an IIS box and my date formatting is coming out quite strange utilizing the following query: $strSQL = "SELECT Indiv.Lastname, Indiv.Firstname, IndivClient.StartDate, IndivClient.Type, IndivClient.StartDate FROM Indiv INNER JOIN IndivClient ON Indiv.NameID = IndivClient.NameID WHERE (((IndivClient.Type)='QSuspect') AND ((IndivClient.StartDate) Between $workday And Date()));"; and the following output code print "<td>$directory->value</td></tr>"; I get dates in this format 1021006800 If I use a simple date string I get dates in the normal d/m/y format.
View Replies !
Formatting Error In IE
I've created a form in php which displays and works perfectly in Opera. However, when I bring it up in IE, the text and input boxes are separated by almost half the page and the submit does not work. The code follows - any assistance would be appreciated.
View Replies !
PHP Text Formatting
I'm wondering if someone can help me out with a small but no less importam problem I have? I'm using the code below to call text from a MySQL database field <td>".$rs[2]."</td> The problem is that the text appears with the web page like Sentence 1 Sentence 1 Sentence 1 and not like Sentence 1 Sentence 1 Sentence 1 as it should be, any suggestions?
View Replies !
Formatting Dates?
Im reading a csv file with php and getting a date in the form 30/09/07 Which I am trying to insert into a mysql table which has the field formatted as yyyy-mm-dd hh:mm:ss . I cant get it to insert the field remains blank How do I do this?...
View Replies !
Formatting Dates
I can't get my date to properly display. It is $birthday. It is formatted as a time stamp. Previouslu, I had it in yyyy-m-d format. Neither worked! The output I get from the code below is Age: 33 (December 31, 1969). WHY? $today = time(); $age= ($today - $birthdate)/60/60/24/365.25; $f_age = sprintf("%01.0d", $age); echo "Age: $f_age "; $f_birthday = date("F d, Y", $birthday); echo "($f_birthday)<br>";
View Replies !
Formatting String
i have a variable that holds a string, the held string can be any string including HTML tags, here is an example. PHP Code:
View Replies !
String Formatting
i have built a forum for my site with php an mysql. a user submits raw text from a textarea into a table. when the text is pulled for display i run it through a function called "format_post( )." PHP Code:
View Replies !
#$!%& Date Formatting.
I've looked through every OTHER date format thread, I've even tried 2 or 3 different methods of formatting the date. I even had a thread back in May about this, and I still haven't gotten it to work. PHP Code:
View Replies !
Formatting XML Data
I am currently working quite a bit with XML files and i keep running into the same problem. Many times i want to split the text into a paragraph, or make it an unordered list. How do you all format your XML idea.
View Replies !
Textbox Formatting
say you've got this textbox that asks for a visitors first name. Is there a way to make the first letter of their name CAPITALIZED even if they typed it in lower-case? (i.e. they type "billyjoe" and I want the output to be "Billyjoe" with a capital B) I've been searching for a while, but haven't been able to come up with anything yet.
View Replies !
Formatting Number
Can sombody tell me the best way to format a number in this way. 456.45657 must be 456,46 So the point becoms a comma and I would have 2 digits i.pv. 5
View Replies !
PHP And Number Formatting
When I add 2 items in the cart less than $1000.00, the formatting of the numbers display fine. When for example I got 2 items that cost 3475.00, the total cost the the two items is displayed as 6, and NOT 3475.00. I am using the the sprintf function, and I believe my problem lies in the fact that I don't know the correct format to display numbers in excess of 1000.00?
View Replies !
Text Formatting
I'm having a problem with PHP, mysql and HTML. I am writing a message board for my site using PHP and mysql. I am running into a problem however with text formatting. Right now, the text for a message is entered into a text area. When the user submits the form the text is sent to a mysql database. All this works fine. My problem comes when reading the text FROM the database. If I use PHP to create a table and read the text into a cell, all of the formmatting is lost. No line breaks, tabs, etc... it just lumps all of the text together. I can use a <PRE> tag and then put the text in and it will preserve the formatting with line breaks, etc. The problem with this is that it wont word wrap. So if i type alot without a hard line break, then when it reads from the database using a <PRE> tag it puts all of the text on one line and stretches the table. Because the <PRE> tag will display it with its original formatting I know that the formatting is being stored in the mysql. So I either need to find out how I can wordwrap a <PRE> tag (in IE). OR I need to know how I can get PHP and HTML to restore the original format of the text without using a <PRE> tag.
View Replies !
Formatting Strings
I am currently using sprintf to format a report from a MySQL database data. I was wondering if there is an easy way to format text besides using sprintf. See below for the example I need to recreate. If any lines exceed the 75 column the need to wrap to the next line and indent 24 spaces. PHP Code:
View Replies !
Formatting Number.
I am trying to display prices on a shopping cart system, but need to be able to display the prices in the form £x.yy, at the moment I am getting things like: £4 £4.2 £4.123 How can I make PHP display a floating point number with only/at least 2 decimcal places?
View Replies !
Php Date-Formatting
I have a date value that I pull from a .csv file. After reading the file and storing the values in an array the value of the date could be found in $array[1], for example. while (($data = fgetcsv($handle,5000, ",")) !== FALSE) { $mydate = $data[3]; // here is the array value that holds the date } The date will be in either m/d/yyyy or mm/dd/yyyy format. Here is the problem. I need to display this date on the page in "long" format - i.e. January 5, 2005 instead of 1/5/2005 or 01/05/2005. I have tried to use the date() function, however I can only get the formatting to work with the current date and not with an 'existing' date. date("d.m.Y", $mydate); // this does not work, I get a date from 1969...
View Replies !
Formatting A Date
I have two varibles, one called $cycle_through_the_month and another called $display_month. "$cycle_through_the_month" displays a date, such as "5" for the 5th day, "18" for the 18th day and so on "$display_month" displays a month and year, such as "MARCH 2007" or "NOVEMBER 2007". Combined together like "$cycle_through_the_month $display_month" produces something like 2 APRIL 2007 or 26 JUNE 2007. What I want to do is to format these so that they print out like 02/12/2007 or 29/11/2007
View Replies !
Email Formatting
I have a php form that is filled out and then submitted. When it is submitted a copy of the information that was submitted is sent to me via email and another person that is named on the form is also sent this same email. The copy the other person receives is fine. The copy I receive is all messed up, as if it is just all one single line with all formatting ignored. The form also generates a separate message to the person that filled out the form. This message is fine as well. Only the copy sent to me is messed up. To be sure the form is one php file, but it refers to another php file. Ok. I will admit that I am new to this. This form was created by someone that recently left the company. It was handed to me with the instructions to get it working. I just don't know where to start. I would copy and paste something, but I'm not sure what part you would want to see. Any direction would be most appreciated. I will try to learn PHP, but I cannot do it on the timetable my boss expects.
View Replies !
Paragraph Formatting
we have some paragraphs that have <BR>,<P> buried in them and want to modify them so that <BR> stars a new line and <P> begins a new paragraph. We tried the below: $NOTE = str_replace("<P>","n ",$NOTE); $NOTE = str_replace("<BR>"," ",$NOTE); It looks like the 1st replace does not work and the second one does. We are outputting the paragraphs to a PDF generatorn and it needs a text file with proper line and paragraph codes.
View Replies !
How To Do Paragraph Formatting
I've been learning from the website for a long time now and I decided to start a small project. I'm writing some software that will be used by me as a type of blog, it's going really well and I'm almost finished. I've got a problem though, I wish to know how to do paragraph formatting. When I enter large amount of text inside a textbox, I want it to be formatted as it's typed in the textbox when it's output.
View Replies !
Textarea Formatting
Here is the scenario: In my php page I have a textarea for people to type into. When the users type their text and submit the form, all formatting is lost. Now, I did tell the users that this isn't a word processor! Anyway, I could use buttons similar to this forum to insert html tags like <p> etc, but, believe me, the users would never get the hang of how they work and they would delete them, and then cry about no formatting! All I really need is to have line breaks, just like the one above, which I got by hitting the Enter key twice. So, when I echo the text it will at least have 2 like breaks which will be fine for a paragraph break. I have looked at the manual, and at nl2br() in particular, but I'm not exactly sure how this works. It seems to be saying that when a user hits the Enter key, either or is added instead of <p>, and the database reflects this if I have a look...apparently. I'm not at the DB so I can't have a look. So, could someone explain to me how to use nl2br() (if that is indeed the correct function), or else perhaps how to retain the line breaks and paragraph breaks that the use enters in the html textarea please? Also, if I'm reading other's experiences with the same problem, do MAC's and PC's both use either or ? I'm a bit confused and most of our users use MAC's, but not all
View Replies !
Number Formatting?
Currently I am extracting a number from a mysql database. It is coming out as 4156 but how can i get it formatted so that it puts a , after the 4? 4,156 This record is dynamic so it is incremented all the time, so it will eventually get to something like 4324455 which should view as 4,324,455 How can I get this to work? Is there some function in PHP that does this?
View Replies !
Formatting With A Comma>
i inserted a salary into mysql with a text file but the command i said was to end field with comma, so i just made 750,000 like this in the txt file like this 750000. ok so how can i format my php to display it as the 750,000 and even better add a floating dollar sign would help as well Code:
View Replies !
Correcting Php Formatting
I am trying to output data from the db through php. echo "<div style="overflow: auto; width: 585px; height: 370px; frameborder:0"><table>"; but when i try to use a div, i receive the following error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ''
View Replies !
Formatting Text
I have some PHP driven text that is not retaining its formatting and I have read the source on both of the following pages for that text and cannot see what happened. This page the text in the footer is correct, (brown text) Correct text color. This page the text in the footer is no longer brown and the text in the table on the left, (Golden Fleece Award, Upcoming Conferences, etc) also will not retain their text color formatting. Incorrect Text Color . I can't see why. Anyone see the problem?
View Replies !
Formatting Decimals
I have this line. $form .= "<td>£$price[$i] ex VAT <br />£".$price[$i]*1.175." inc VAT</td>"; this returns £41.95 ex VAT £49.29125 inc VAT I would like the inc VAT price to become £49.29. I have tried $form .= "<td>£$price[$i] ex VAT £".printf("%.2f", ($price[$i]*1.175))." inc VAT</td>"; But this doesn't work.
View Replies !
Parsing Formatting
I'd like to use formatting in my forum's messages, in the same way as this forum works (ie. adding [b ][/b ] is rendered as bold tags when the message is displayed). what's the best method to approach this with? I could use strstr to detect if there are any "[" characters in the message and then extract the string until a corresponding "[/" is found. but this seems like a slow way to do it. Is this something that a regular expression could do?
View Replies !
Formatting Of Text
When I display large piece of text on a web page from a text field in my database the formatting such as paragraphs line feeds are lost, unless I include the appropriate html tags in it. How can I display the text as written initially?
View Replies !
Foreach Formatting Except On Last
I'm using foreach to take the elements of an array and put them in a string (that I'm using for some javascript) Anyway, I ultimately need it to output like this example (with the quotes): "cat" , "dog" , "mouse" , "turkey" I'm using this method <?php echo '"' echo $searchData['animal'][0]; echo '",' However, that gives me, for example "cat" , "dog" , "mouse" , "turkey" , I'm actually using php to put together an array for javascript - in Firefox, it doesnt matter that I have that comma after the last element - but, after about an hour of troubleshooting, I've realized it matters for IE.
View Replies !
Datetime Formatting
If I have a datetime field that saves info in the format 2007-07-21 16:59:36, and use: <?php $result = mysql_query ("SELECT table.date_added FROM table"); while ($row = mysql_fetch_array($result)) { $date = $row['date_added']; echo $date; } How can I format the info that's been outputted from the query to 'Saturday 21st July 2007 16:59:36' ?
View Replies !
HTML Formatting
I have a class called page. This class outputs a page in html. Now I have a function called OutPutHtml This outputs html, however I want to be able to do this: outputhtml('<body> <something'); So I can keep it nice and formatted. But when I do this there are huge gaps in the html. How can I do this so it formats it? Code:
View Replies !
Currency Formatting
I am in the process of making a simple shopping cart page for my employees website, and through the administration panel for this application you set the price of the item as a whole number IE (£59.99 entered as 5999 in admin panel) which is then stored in the MySQL database. All well and good, but when i am displaying these items/products on the interface for the customers i am using number_format() to format the price but PHP rounds it to the nearest number so instead of seeing £59.99 i am getting £60.00 i have searched the php manual and looked at other peoples posts in various forums for this problem and still havent found a solution.
View Replies !
Add Formatting Option
I've developed this simple piece of script for my client so she can easy add news to her homepage from the admin Panel, I would like some advice on how i would go about adding some formatting options to the content in the textfield be, like bold, italic and linking tags etc. <html><head><title>Add News</title></head> . PHP Code: <body> <form action="" method="get"> <textarea name="newscontent"></textarea> <br><br> <input type="submit" name="Submit" value="Add"></form> </body> </html> <?php $Submit = $_GET['Submit']; if(isset( $Submit )) { .............
View Replies !
Formatting Forms
I am building a guestbook usin PHP/Mysql and I'm wondering how to set up the forms so that they keep the text formatting when I display the info from the database. Example: Hi, This is my guestbook entry, Onoff as opposed to: Hi,This is my guestbook entry,Onoff
View Replies !
Is This Correct Formatting
PHP Code: $done = @mail($to, $subject, $message, $from); if (!$done) { echo ("Error sending mail message"); } Im not sure whether you should have just !$done, should it be !isset($done) ? Or not in this context?
View Replies !
Formatting Printout
I've been working on a task to develop a few pages that take a list of members of a golf club and put those whohave entered a competition into a random draw. I've got everything to work (more or less) but I am struggling to get the output into a format that looks good ie aligned in columns as below... Code:
View Replies !
|