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


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

2. This is a description2

3. This is a description3

4. This is a description4
Link 4

Thanks in advance to your help guys.

Member Avatar

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....