Jump to content

Unable to get INSERT to work correctly?


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
https://forums.phpfreaks.com/topic/291548-unable-to-get-insert-to-work-correctly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.