Jump to content

Mysql Displaying Anything over 0


Deanznet

Recommended Posts

Checking now but stay with me

 

			$item_exists_query = mysql_query("SELECT * FROM items WHERE item_name='$item'");

 

the last part where it says $item should that be $itemID since $itemID is the name?

 

if i change it to that than it says cannot find item

This is where your cash is defined. check to see if these values are correct.

 

$user_info_query = mysql_query("SELECT * FROM phpbb_users WHERE user_id='$user_id'");

$user_info_array = mysql_fetch_array($user_info_query);

$user_cash = $user_info_array['user_points'];

 

then check to see if the price of the item is correct:

 

$price_query = mysql_query("SELECT * FROM items WHERE item_name='$itemID'");

$price_array = mysql_fetch_array($price_query);

$price = $price_array['item_price'];

 

Edit: disregard what was previously in this post. it was incorrect

 

Sorry i looked at the error checking and the error for You ave no money was swapped with Item out of stock so check this info:

 

the query is:

 

mysql_query("SELECT * FROM items WHERE item_name='$itemID'");

 

 

and the row is:

 

item_quantity.

 

is this correct?

Im lost lol

 

here are my tables

 

CREATE TABLE `items` (
  `item_id` int( NOT NULL default '0',
  `item_desc` varchar(255) NOT NULL default '',
  `item_price` int( NOT NULL default '0',
  `item_quantity` int( NOT NULL default '0',
  `item_picture` varchar(255) NOT NULL default '',
  `item_sellback` int( NOT NULL default '0',
  `item_in_shop` tinyint(2) NOT NULL default '0',
  `item_name` varchar(255) NOT NULL default ''


  `item_id` int( NOT NULL default '0',
  `item_name` varchar(255) NOT NULL default '',
  `user_owner_id` int( NOT NULL default '0',
  `item_quantity` int( NOT NULL default '0'

And than phpbb_user with user_points 

ahh theres the mistake. the sql query had "WHERE item_name='$itemID'" and item_name should have been item_id

 

replace this line:

 

$price_query = mysql_query("SELECT * FROM items WHERE item_name='$itemID'");

 

with this line:

 

$price_query = mysql_query("SELECT * FROM items WHERE item_id='$itemID'");

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.