# Mysql text field\<br/\>

**URL:** https://forum.kirupa.com/t/mysql-text-field-br/185427
**Category:** Uncategorized
**Created:** [April 13, 2006, 9:40am UTC](https://forum.kirupa.com/t/mysql-text-field-br/185427 "2006-04-13T09:40:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![keti](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@keti](https://forum.kirupa.com/u/keti)
#### Post date: [April 13, 2006, 9:40am UTC](https://forum.kirupa.com/t/mysql-text-field-br/185427/1 "2006-04-13T09:40:19Z")

</div>

hi everybody,

my problem,

xml/php code

```php

<?php
include_once("connection.php");
$key = mysql_result(mysql_query("SELECT product_id FROM product_read WHERE id='1' "),0);
$result = mysql_query("SELECT * FROM jos_product WHERE product_id='".$key."' ");
$data=mysql_fetch_object($result);
 
echo '<?xml version="1.0" encoding="iso-8859-9"?>'; 
echo '<images>';
if ($data->big_image!="" OR $data->caption!=""){
echo '<pic>'; 
echo "<image> ".$data->big_image." </image>"; 
echo "<caption> ".$data->caption." </caption>"; /*mysql type text*/
echo '</pic>';
}
echo '</images>'; 
?>

```

xml print

```auto

[COLOR=#0000ff]<?xml version="1.0" encoding="iso-8859-9" ?>[/COLOR] 
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]images[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]pic[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]image[/COLOR][COLOR=#0000ff]>[/COLOR] **images/product/big_image/1.jpg** [COLOR=#0000ff]</[/COLOR][COLOR=#990000]image[/COLOR][COLOR=#0000ff]>[/COLOR] 
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]caption[/COLOR][COLOR=#0000ff]>[/COLOR][COLOR=#000000] **test 123 test 123 test 123 test 123 test 123 test 123** [/COLOR][COLOR=#0000ff]</[/COLOR][COLOR=#990000]caption[/COLOR][COLOR=#0000ff]>[/COLOR] 
[COLOR=#0000ff]</[/COLOR][COLOR=#990000]pic[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]</[/COLOR][COLOR=#990000]images[/COLOR][COLOR=#0000ff]>[/COLOR]

```

as

```auto

System.useCodepage = true;
function loadXML(loaded) {
 if (loaded) {
  xmlNode = this.firstChild;
  image = [];
  description = [];
  total = xmlNode.childNodes.length;
  for (i=0; i<total; i++) {
   image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
   description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
  }
  firstImage();
 } else {
  content = "file not loaded!";
 }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("flashc.php?" + Math.random());
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
 if (Key.getCode() == Key.LEFT) {
  prevImage();
 } else if (Key.getCode() == Key.RIGHT) {
  nextImage();
 }
};
Key.addListener(listen);
previous_btn.onRelease = function() {
 prevImage();
};
next_btn.onRelease = function() {
 nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
 if(current_pos == 1){
  previous_btn._visible = false;
 } else {
  previous_btn._visible = true;
 }
 if(current_pos == total){
  next_btn._visible = false;
 } else {
  next_btn._visible = true;
 }
 filesize = picture.getBytesTotal();
 loaded = picture.getBytesLoaded();
 preloader._visible = true;
 if (loaded != filesize) {
  preloader.preload_bar = 100*loaded/filesize;
 } else {
  preloader._visible = false;
  if (picture._alpha<100) {
   picture._alpha += 10;
  }
 }
};
function nextImage() {
 if (p<(total-1)) {
  p++;
  if (loaded == filesize) {
   picture._alpha = 0;
   picture.loadMovie(image[p], 1);
   _root.desc_txt.htmlText = description[p] **[COLOR=red]+"<br />";[/COLOR]**
   picture_num();
  }
 }
}
function prevImage() {
 if (p>0) {
  p--;
  picture._alpha = 0;
  picture.loadMovie(image[p], 1);
  _root.desc_txt.htmlText = description[p] **[COLOR=red]+"<br />";[/COLOR]**
  picture_num();
 }
}
function firstImage() {
 if (loaded == filesize) {
  picture._alpha = 0;
  picture.loadMovie(image[0],1);
  _root.desc_txt.htmlText = description[0] **[COLOR=red]+"<br />";[/COLOR]**
  picture_num();
 }
}
function picture_num() {
 current_pos = p+1;
 pos_txt.text = current_pos+" / "+total;
}

```

flash photo gallery description print

test 123

test 123

test 123

test 123

…

[SIZE=2]the flash print i want is the same as the sample  
[/SIZE]  
test 123  
test 123  
test 123  
…  
?

---

<div class="post-metadata">

### Author: ![Ben\_Smith](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_smith/32/1118_2.png) [@Ben\_Smith](https://forum.kirupa.com/u/Ben_Smith)
#### Post date: [April 13, 2006, 9:48am UTC](https://forum.kirupa.com/t/mysql-text-field-br/185427/2 "2006-04-13T09:48:20Z")

</div>

Don’t you need to use a foreach statement, or a while statement to make the XML nodes repeat?

```php
include_once("connection.php");
$key = mysql_result(mysql_query("SELECT product_id FROM product_read WHERE id='1' "),0);
$result = mysql_query("SELECT * FROM jos_product WHERE product_id='".$key."' ");

echo '<?xml version="1.0" encoding="iso-8859-9"?>'; 
echo '<images>';
while($data = mysql_fetch_array($result)){
 if ($data['big_image']!="" OR $data['caption']!=""){
 echo '<pic>'; 
 echo "<image> ".$data['big_image']." </image>"; 
 echo "<caption> ".$data['caption']." </caption>"; 
 echo '</pic>';
 }
}
echo '</images>';

```

Try that  
Ben

---

<div class="post-metadata">

### Author: ![keti](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@keti](https://forum.kirupa.com/u/keti)
#### Post date: [April 13, 2006, 2:07pm UTC](https://forum.kirupa.com/t/mysql-text-field-br/185427/3 "2006-04-13T14:07:56Z")

</div>

> [@RampagingWalrus](#):
>
> Don’t you need to use a foreach statement, or a while statement to make the XML nodes repeat?
> 
> ```php
> include_once("connection.php");
> $key = mysql_result(mysql_query("SELECT product_id FROM product_read WHERE id='1' "),0);
> $result = mysql_query("SELECT * FROM jos_product WHERE product_id='".$key."' ");
>  
> echo '<?xml version="1.0" encoding="iso-8859-9"?>'; 
> echo '<images>';
> while($data = mysql_fetch_array($result)){
> if ($data['big_image']!="" OR $data['caption']!=""){
> echo '<pic>'; 
> echo "<image> ".$data['big_image']." </image>"; 
> echo "<caption> ".$data['caption']." </caption>"; 
> echo '</pic>';
> }
> }
> echo '</images>';
> 
> ```
> 
> Try that  
> Ben

The thing I want is to arrey the datas line by line, in text area of MYSQL. The problem I face is I get this datas with an empty space between every line. How can I fix this and get the data line by line without any space.  
I think I put \<br/\> in wrong place , can you please explain the correct place to put this. Also for your information my code is working perfectly.

Thanks in advance

---

<div class="post-metadata">

### Author: ![Ben\_Smith](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_smith/32/1118_2.png) [@Ben\_Smith](https://forum.kirupa.com/u/Ben_Smith)
#### Post date: [April 13, 2006, 2:42pm UTC](https://forum.kirupa.com/t/mysql-text-field-br/185427/4 "2006-04-13T14:42:06Z")

</div>

In a text area of MySQL…I’m sorry I don’t really get what you mean.

---

<div class="post-metadata">

### Author: ![Ben\_Smith](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_smith/32/1118_2.png) [@Ben\_Smith](https://forum.kirupa.com/u/Ben_Smith)
#### Post date: [April 13, 2006, 2:42pm UTC](https://forum.kirupa.com/t/mysql-text-field-br/185427/5 "2006-04-13T14:42:46Z")

</div>

My code does make an XML file with no spaces…I think
