Page 1 of 1

Error when deleting with PHPMYADMIN

Posted: Sun Jun 29, 2003 5:51 am
by Zeceer
Hi,

I have a column in a database called products. The column name is info, and it contains the products info. The option for this column is TEXT. What it contains is for an example:

gfjkgjfg
<br>
fdfsdfsdf
<br>
<br>
fsdfsdfsdf

The problem is that when I have new lines in the column, it want be deleted. To delete it i have to smash the whole content together.

Like this:

gfjkgjfg<br>fdfsdfsdf<br><br>fsdfsdfsdf

Then it wil delete. What is this all about? I have to have new lines in the colums since the info comes from a text box. When inputting data to the database I use nl2br() in the info column.

Posted: Sun Jun 29, 2003 6:08 am
by patrikG
One thing off the top of my head: use nl2br() when you read from the db, not when you write.

Do post the code you use to write to the DB-table - makes things easier.

Posted: Sun Jun 29, 2003 6:34 am
by Zeceer
Done that. Sounds a little smarter :D . But it still don't fix my "weird" problem :?

The code I use to write to the database:
$query = "INSERT INTO products ( `prodnr` , `category` , `product` , `price` , `info` , `short_info` , `weight` , `image` )
VALUES( '".$_POST['prodnr']."' , '".$_POST['category']."' , '".$_POST['product']."' , '".$_POST['price']."' , '".$_POST['info']."' , '".$_POST['short_info']."' , '".$_POST['weight']."' , '".$_POST['image']."' )";
But I don't think theres anything wrong there, the data is safely added to the database, but I can't delete it. Could it have to do with some settings in the info column?