473,800 Members | 2,614 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formatting

22 New Member
Hello All,

Thanks for any help you can give in advance. This is what I'm trying to do...I have entries going into a database. The entries can be UP to 1500 words. I want the query results from the database to be formatted for publishing in a book. For instance, every 5-8 sentences is a paragraph, at every new paragraph you indent, if one entry is less than a paragraph (i.e. 10 words) continue the next entry where the last entry left off until 5-8 sentences is reached.

Currently I have it coded whereby every entry is indented but that is all. This is the code I have:


Expand|Select|Wrap|Line Numbers
  1. <style>
  2.  
  3. p.new {
  4.    text-indent:1em;
  5.    margin-top: 0;
  6.    margin-bottom: 0;
  7.    margin-left: 0;
  8.    margin-right: 0;
  9.    font-size: 18px;
  10.  
  11.   }
  12. </style>
[PHP]$db=mysql_conne ct ($sql_host, $sql_user, $sql_password) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($sql_db);
if(isset($_GET['topic']))
{
$topic=$_GET['topic'];
$query="SELECT ENTRY FROM entries WHERE TOPIC='$topic'" ;
}
elseif(!isset($ _GET['topic']))
{
$query="SELECT ENTRY FROM entries";
}

$result = mysql_query($qu ery) or die (mysql_error()) ;
$num=mysql_num_ rows($result);

$i=0;
$Z=i+1;

if($i<$num)
{

while($i<$num)
{
$myentry=mysql_ result($result, $i, "ENTRY");
echo '<p class="new">' .$myentry.'</p>';
$i++;
$Z++;
}

}
else{
echo "There are no entries in the database";
}
?>[/PHP]

Can someone help me accomplish what I'm trying to do.
Dec 28 '07 #1
3 1058
pbmods
5,821 Recognized Expert Expert
Heya, Lilbit.

How would your app be able to determine when a new paragraph occurs?
Dec 31 '07 #2
lilbit02
22 New Member
Now that's a good question. Don't know. What do you suggest I do?
Jan 3 '08 #3
pbmods
5,821 Recognized Expert Expert
Heya, Lilbit.

You'd need some kind of hinting, such as a line break or extra punctuation. You could assume that a new paragraph occurs every x sentences, but this is probably not optimal.
Jan 3 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5939
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be terminated by pressing ++ and then terminate the process. I searched the entire internet and found out that there could be two things wrong (both of them are mentioned in the bug list on the access
2
1948
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with formatting to another program. The help file reads: "Formula One maintains its own internal clipboard and also supports text on the Windows clipboard. The internal clipboard is more flexible than the Windows clipboard. The internal clipboard...
4
4163
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I want all of the controls in whatever is the CURRENT record to have it's data bolded on the screen. (Question #1: Is there a SIMPLE way to refer to the Current Record?) I've been trying to use a Bookmark to specify the current record, but it
4
3144
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the background colour. In A2000 it works great, but in A2003 the background doesn't always change and when it does it only changes when the record looses the focus. Any way around this? Is it a bug? Or have they "improved" it?
1
5021
by: GGerard | last post by:
Hello Is there a way to use a variable in the Conditional Formatting of a Textbox? Example : I want the background of a textbox in a continuous form to change color when the value of "MyField1" is True. No problem, I just need to write "Expression is" and " = -1 "
4
3236
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
7
3119
by: L. Scott M. | last post by:
Have a quick simple question: dim x as string x = "1234567890" ------------------------------------------------------- VB 6 dim y as string
8
1780
by: gopal | last post by:
Hi I am trying to write to log file but the formatting of string is not properly aligned in log file result The results looks some thing like this OK move.xml Successful OK AppUser_ifrUsers.asp Successful
8
8514
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works perfectly. However, I have code that runs under the ON CLICK event. The code changes the focus to other controls, which means the conditional formatting is no longer displayed. This part makes sense to me. Here's what doesn't make sense. The last...
4
13204
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays "No." The conditional formatting is set up to read the 'Yes' or 'No' value and color the text accordingly. I have an event in the subform that allows users to update the sales. It actually runs an update query behind the scenes. What I want to...
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.