I have something to know guys, is it possible to combine all the data in one fields and it will display separately?

Example:

I have 3 fields (id, description, link) and i store this in the ff. with a separator "|":

description fields

This is a description1 | This is a description2 | This is a description3 | This is a description4

link fields

Link1 | Link2 | Link3 | Link4

And it will display like this :

1. This is a description1
Link1

2. This is a description2
Link2

3. This is a description3
Link3

4. This is a description4
Link 4

Thanks in advance to your help guys.

Recommended Answers

All 2 Replies

Member Avatar for P0lT10n

use explode("string that delimite", "string to be removed") it will be like this

$descriptions = explode("|", $yourDescriptionVar);
echo $desciptions[0];
echo $desciptions[1];
echo $desciptions[2];
// and so on...

For more info, see this.

Another thing you can try is serialize data.
1. Create php array with all data you want to save.
2. Serialize that array.Check this for help
3. Save this in database.
4. Retrieve database and unserialize it to use that php array again.check how to unserialize.

Hope this helps....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.