Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Can I combine the values in the database with an comma (,) instead of next line?
Topper Offline
Junior Member
**
Posts: 8
Joined: May 2012
Post: #1
Can I combine the values in the database with an comma (,) instead of next line?
Can I combine the values in the database with an comma (,) instead of next line?

Cause I am using the following code to check in PHP if one thread match with another thread:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

$id1 = '1,2,3,4,5,6,7,8,9,10'; // the values from thread_field_data where tid=1
$id2 = '10,11,12,13,14,15,16'; // the values from thread_field_data where tid=2

// splitting them up into an array
$one = explode(',', $id1);
$two = explode(',', $id2);

// making the check
$result = count(array_intersect($one, $two));
if($result > 0) {
    echo 'Something matched!';
}

?>


I don't know how to do that with newlines?

06-05-2012 08:51 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Can I combine the values in the database with an comma (,) instead of next line? - Topper - 06-05-2012 08:51 PM

 Standard Tools
Forum Jump: