Yes, the best way is to use a seperate table with identifiers (e.g. post_id) to identify the posts.
Never save more than one information per field - saving the information in an array in the same table is cruel.
However, do NOT store the IP address 'as is' in the database as this is illegal in many countries and can cause a lot of trouble!
Instead use a hashing function like
hash_hmac (http://php.net/manual/de/function.hash-hmac.php), hash the IP address and save the hash instead..
Because hashes are one-way functions, this will ensure anonymity for the user but still give you the opportunity to prevent users from voting several times.