[Unknown]
Global Moderator
YaBB God
    
Posts: 7830


|
 |
Re:Yet Another Phpbb2 --> YabbSE 1.5 Request
« Reply #60 on: May 15, 2003, 11:23:57 PM » |
|
Never read a book on PHP or MySQL.
# Update the messages table. UPDATE {$db_prefix}messages # Change the posterIP variable. Seperate it with .'s. SET posterIP=CONCAT_WS('.', # First number. Two bytes, hex. CONV(SUBSTRING(posterIP, 1, 2), 16, 10), # Second number. Two bytes, hex. CONV(SUBSTRING(posterIP, 3, 2), 16, 10), # Third number. Two bytes, hex. CONV(SUBSTRING(posterIP, 5, 2), 16, 10), # Last number.... two bytes, hex. CONV(SUBSTRING(posterIP, 7, 2), 16, 10) );
CONV converts between bases... base 16 (hex) to base 10 (decimal), in this case. SUBSTRING fetches a part of the string. CONCAT_WS puts a string together with a seperator. So, CONCAT_WS(' ', 'a', 'b', 'c') would be 'a b c'. It's like join().
-[Unknown]
|