Jump to content

Unable to get INSERT to work correctly?


Kryllster
Go to solution Solved by Kryllster,

Recommended Posts

MySQL version 5.1.73-cll

 

I can't seem to get the inventory table to insert the information I have stared in an array any help would be appreciated!!

<?php
$username = $_SESSION['username'];
ini_set('display_errors',1); 
error_reporting(E_ALL);
	
	//include "php/db/db_config.php";
	include "php/db/db_config.php";
	include "php/db/item_connect.php";
	
	$id = $items_id['id'];
	$player = $account_info['player_id'];
	
	//Update database
	$sql = mysqli_query($my_database,"INSERT INTO inventory ( player_id, username, id ) VALUES('$player', '$username', '$id')");
				
//echo values of item id		
echo "<div class=\"loot\">";	
echo "<b>Required Level:" . $items_id['requ_level'] . "</b><br />";
echo "<b>Name:" . $items_id['name'] . "</b><br />";
echo "<b>Min Str:" . $items_id['min_str'] . "<br />";
echo "<b>Min Int:" . $items_id['min_int'] . "<br />";
echo "<b>Min Dex:" . $items_id['min_dex'] . "<br />";
echo "<b>Type:" . $items_id['type']. "<br />";
echo "<b>Min Physical Dmg:" . $items_id['min_dmg'] . "<br />";
echo "<b>Max Physical Dmg:" . $items_id['max_dmg'] . "<br />";
echo "<b>Min Magic Dmg:" . $items_id['mag_attk_min'] . "<br />";
echo "<b>Max Magic Dmg:" . $items_id['mag_attk_max'] . "<br />";
echo "<b>Phys Defense:" . $items_id['phy_def'] . "<br />";
echo "<b>Magical Defense:" . $items_id['mag_def'] . "<br />";
echo "</div>";
?>

I get no errors or notices and the info fields show up as being populated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.