Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
[RELEASE] `Furniture` to `Items_Base` Converter
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Ptsface12" data-source="post: 225542" data-attributes="member: 5744"><p>Hi guys,</p><p><strong>BEFORE YOU POST: </strong>I know this has already been released before. However, I got alot of errors with it (although I was probably doing something wrong, but hey-ho). Also, this script was written with MySQLi as the MySQL functions are decapitated.</p><p> </p><p>[CODE]<?php</p><p>$user = "root";</p><p>$pass = "whatever";</p><p>$db = "lol";</p><p>$host = "localhost";</p><p> </p><p>$link = mysqli_connect($host, $user, $pass, $db) or die("Error " . mysqli_error($link));</p><p>$query = "SELECT * FROM furniture";</p><p>$result = $link->query($query);</p><p> </p><p>$appendstring = "INSERT IGNORE INTO `items_base` (`item_id`, `sprite_id`, `public_name`, `item_name`, `type`, `width`, `length`, `height`, `allow_stack`, `allow_walk`, `allow_sit`, `allow_recycle`, `allow_trade`, `allow_marketplace_sell`, `allow_gift`, `allow_inventory_stack`, `interaction_type`, `cycle_count`, `vending_ids`) VALUES ";</p><p> </p><p>while($row = mysqli_fetch_array($result)) {</p><p> $itemid = str_replace("'","", $row["id"]);</p><p> $name = str_replace("'","", $row["public_name"]);</p><p> $itemname = str_replace("'","", $row["item_name"]);</p><p> $type = str_replace("'","", $row["type"]);</p><p> $spriteid = str_replace("'","", $row["sprite_id"]);</p><p> $width = str_replace("'","", $row["width"]);</p><p> $length = str_replace("'","", $row["length"]);</p><p> $height = str_replace("'","", $row["stack_height"]);</p><p> $stack = str_replace("'","", $row["can_stack"]);</p><p> $walk = str_replace("'","", $row["is_walkable"]);</p><p> $sit = str_replace("'","", $row["can_sit"]);</p><p> $recycle = str_replace("'","", $row["allow_recycle"]);</p><p> $trade = str_replace("'","", $row["allow_trade"]);</p><p> $sell = str_replace("'","", $row["allow_marketplace_sell"]);</p><p> $gift = str_replace("'","", $row["allow_gift"]);</p><p> $stack = str_replace("'","", $row["allow_inventory_stack"]);</p><p> $cycle = str_replace("'","", $row["interaction_modes_count"]);</p><p> $interaction = str_replace("'","", $row["interaction_type"]);</p><p> $vendid = str_replace("'","", $row["vending_ids"]);</p><p> </p><p> $appendstring = $appendstring ."('" . $itemid . "', '" . $spriteid . "', '" . $name . "', '" . $itemname . "', '" . $type . "','" . $width . "','" . $length . "','" . $height . "','" . $stack . "','" . $walk . "','" . $sit ."','" . $recycle . "','" . $trade . "','" . $marketplace . "','" . $gift . "','" . $stack . "','" . $interaction . "','" . $cycle . "','" . $vendid . "'),</br>";</p><p>}</p><p> </p><p>echo substr_replace($appendstring, ";", -6);</p><p>?>[/CODE]</p><p> </p><p>Save it as base.php.</p><p> </p><p>1. Put this file in your directory folder e.g (wwwroot or htdocs).</p><p>2. Replace the details within the file to your; MySQL username, password, database and host (most likely still localhost).</p><p>3. Go to <a href="http://www.yourdomain.com/base.php" target="_blank">www.yourdomain.com/base.php</a></p><p>4. Copy your SQL data and go ahead and paste it as an SQL query and it should work.</p><p> </p><p>With this version, you don't need to remove the comma at the end and replace it with the colon. ALSO if you tried running this as a query in navicat and got duplicate key errors, this will be bypassed by the 'INSERT IGNORE INTO' statement in the sql query.</p><p> </p><p>If you have any issues with this and/or you can't get it to work. Reply with your issue and i'll try my best to help you.</p><p> </p><p><strong>Credits:</strong></p><p>Me 80%</p><p>20% to whoever made the furniture and items_base.</p><p> </p><p>Thanks.</p></blockquote><p></p>
[QUOTE="Ptsface12, post: 225542, member: 5744"] Hi guys, [B]BEFORE YOU POST: [/B]I know this has already been released before. However, I got alot of errors with it (although I was probably doing something wrong, but hey-ho). Also, this script was written with MySQLi as the MySQL functions are decapitated. [CODE]<?php $user = "root"; $pass = "whatever"; $db = "lol"; $host = "localhost"; $link = mysqli_connect($host, $user, $pass, $db) or die("Error " . mysqli_error($link)); $query = "SELECT * FROM furniture"; $result = $link->query($query); $appendstring = "INSERT IGNORE INTO `items_base` (`item_id`, `sprite_id`, `public_name`, `item_name`, `type`, `width`, `length`, `height`, `allow_stack`, `allow_walk`, `allow_sit`, `allow_recycle`, `allow_trade`, `allow_marketplace_sell`, `allow_gift`, `allow_inventory_stack`, `interaction_type`, `cycle_count`, `vending_ids`) VALUES "; while($row = mysqli_fetch_array($result)) { $itemid = str_replace("'","", $row["id"]); $name = str_replace("'","", $row["public_name"]); $itemname = str_replace("'","", $row["item_name"]); $type = str_replace("'","", $row["type"]); $spriteid = str_replace("'","", $row["sprite_id"]); $width = str_replace("'","", $row["width"]); $length = str_replace("'","", $row["length"]); $height = str_replace("'","", $row["stack_height"]); $stack = str_replace("'","", $row["can_stack"]); $walk = str_replace("'","", $row["is_walkable"]); $sit = str_replace("'","", $row["can_sit"]); $recycle = str_replace("'","", $row["allow_recycle"]); $trade = str_replace("'","", $row["allow_trade"]); $sell = str_replace("'","", $row["allow_marketplace_sell"]); $gift = str_replace("'","", $row["allow_gift"]); $stack = str_replace("'","", $row["allow_inventory_stack"]); $cycle = str_replace("'","", $row["interaction_modes_count"]); $interaction = str_replace("'","", $row["interaction_type"]); $vendid = str_replace("'","", $row["vending_ids"]); $appendstring = $appendstring ."('" . $itemid . "', '" . $spriteid . "', '" . $name . "', '" . $itemname . "', '" . $type . "','" . $width . "','" . $length . "','" . $height . "','" . $stack . "','" . $walk . "','" . $sit ."','" . $recycle . "','" . $trade . "','" . $marketplace . "','" . $gift . "','" . $stack . "','" . $interaction . "','" . $cycle . "','" . $vendid . "'),</br>"; } echo substr_replace($appendstring, ";", -6); ?>[/CODE] Save it as base.php. 1. Put this file in your directory folder e.g (wwwroot or htdocs). 2. Replace the details within the file to your; MySQL username, password, database and host (most likely still localhost). 3. Go to [URL='http://www.yourdomain.com/base.php']www.yourdomain.com/base.php[/URL] 4. Copy your SQL data and go ahead and paste it as an SQL query and it should work. With this version, you don't need to remove the comma at the end and replace it with the colon. ALSO if you tried running this as a query in navicat and got duplicate key errors, this will be bypassed by the 'INSERT IGNORE INTO' statement in the sql query. If you have any issues with this and/or you can't get it to work. Reply with your issue and i'll try my best to help you. [B]Credits:[/B] Me 80% 20% to whoever made the furniture and items_base. Thanks. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
[RELEASE] `Furniture` to `Items_Base` Converter
Top