Jump to content
MakeWebGames

[mccode] item images


spellbyte ®
 Share

Recommended Posts

I have had several people asking me how to do this so i will post it here for all to see

run this sql query

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

then simply add this to whatever page u want to display the picture

{$r[

it's really very simple

or use this unedited inventory.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

replace that if you have not modified your inventory.php before

Link to comment
Share on other sites

Re: item images

If i remember correctly... once you add that variable to the items table, if you want to be able to create/delete/edit items on the admin panel, wherever you have it insert an item into the table in the admin panel, add an extra '' on the query

for example, in my edit items function, this query is present

mysql_query("INSERT INTO `items` ( `itmid` , `itmtype` , `itmname` , `itmdesc` , `itmbuyprice` , `itmsellprice` , `itmbuyable` , `itmpic` ) VALUES ('{$_POST['itmid']}', '{$_POST['itmtype']}', '$itmname', '$itmdesc', '{$_POST['itmbuyprice']}', '{$_POST['itmsellprice']}', '$itmbuy')", $c);

you would have to change that to

mysql_query("INSERT INTO `items` ( `itmid` , `itmtype` , `itmname` , `itmdesc` , `itmbuyprice` , `itmsellprice` , `itmbuyable` , `itmpic` ) VALUES ('{$_POST['itmid']}', '{$_POST['itmtype']}', '$itmname', '$itmdesc', '{$_POST['itmbuyprice']}', '{$_POST['itmsellprice']}', '$itmbuy', '')", $c);

Link to comment
Share on other sites

Re: item images

right i am trying to add an extra field to add new item and edit item for the item pics, but when i add the link i get this error

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

it works ok without the link in there, this is what i have added so far

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

any thoughts please anyone?

Link to comment
Share on other sites

  • 5 months later...
  • 7 months later...
  • 1 month later...

Re: [mccode] item images

This is the error i get in Invntory.php

 

Warning: include(mysql.php) [function.include]: failed to open stream: No such file or directory in /home/bfp111/public_html/inventory2.php on line 9

Warning: include() [function.include]: Failed opening 'mysql.php' for inclusion (include_path='.:/x10hosting/php2/pear/PEAR') in /home/bfp111/public_html/inventory2.php on line 9

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/bfp111/public_html/inventory2.php on line 11

 

EDIT: And also, Is there anyway i could add that picture code to admin cp, like when i make an item i choose the picture too, Which code do i use for that and were would i put it?

Link to comment
Share on other sites

Guest Anonymous

Re: [mccode] item images

Warning: include(mysql.php) [function.include]: failed to open stream: No such file or directory in /home/bfp111/public_html/inventory2.php on line 9

Well there's your first problem -- mysql.php is missing.

mysql.php is (IIRC) part of DBS/MCcodes V2 not V1(lite) ...

So the question is ... what version are you running?

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...