Jump to content

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'");

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.