Jump to content
MakeWebGames

[mccode v2] inventory.php


Sp1d3r
 Share

Recommended Posts

I'm making more item types other than a primary weapon, secondary weapon and armor. When editing the inventory.php on line 7 (for me) where it does the db query - SELECT * FROM items WHERE itmid IN...... I added the new {$ir['equip_blank']} and when I save the code and test it i get this error

QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 0, 0, 0)' at line 1

Query was SELECT * FROM items WHERE itmid IN(, 0, 0, 0)

So this maybe a really noob question but I cant find away around it and my last resort was to ask you guys.

I notice the (, 0, 0, 0) at the end is missing a zero were the new {$ir['equip_blank']} is at. Where do I add to the db so that it properly sees it and I'm assuming should look like this when it is correct (0, 0, 0, 0).

Thanks in advance

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

Thanks that did resolve the issue but I still would like to know what I missed. The code already knows the primary weapon is a zero but I cant find where if pulls that data from and if i could them I could just modify the table to have the blank in there too.

On another note after adding the code you suggested it did get past the error but when equipping the particular item i get another error

QUERY ERROR: Unknown column 'equip_blank' in 'field list'

Query was UPDATE users SET equip_blank = 2 WHERE userid=1

where is this field list? and maybe both errors are related as i forgot to change something.

Thanks again.

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

i guess im what mdshare discribed. im not a programmer, i do this for fun and im also a member of these boards but i suppose that doesnt matter, since even a admin bashes you.

 

if anyone else has a on topic reply, please post.

thanks.

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

 

i guess im what mdshare discribed. im not a programmer, i do this for fun and im also a member of these boards but i suppose that doesnt matter, since even a admin bashes you.

 

if anyone else has a on topic reply, please post.

thanks.

Doesn't hardly seem fair sometimes to us beginners trying to learn does it...

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

The reason I asked is two fold. The main reason is that it looks like from where this topic was going, that there was going to be a long drawn out sequence of me suggesting something for you to try. Then, when you did that, another thing crops up, and you want another suggestion. Eventually, the script might get finished, but not without having made a bunch of back and forth posts which, quite frankly, that level of support is something I'm not willing to do for free.

I do, and others on this forum do as well, offer our services for hire.

Secondly, I didn't just want to say: "It looks like you don't know much about php and mysql. You need to learn the basics first, and then attempt to work on a game.", without asking you first if you had these skills. Now I know you don't have these skills, and I can say that without assuming anything ;)

If I may draw an a-n-a-l-ogy (a n a l got censored...): Most people don't take things they know almost nothing about apart and try to fix them. I.e., cars, tvs, computers, and so on. And if they did, and they couldn't solve the problem, seeking free support about how to put together a transmission when you know very little, if nothing at all, about a transmission, is likely to end up with to results:

The person helping you does all the work. The person helping you decides you're not qualified to attempt such vast repairs at this time and instructs you to seek professional help, or study up some more.

 

Anyways, back to your question: "where is this field list? and maybe both errors are related as i forgot to change something."

You don't know where the "field list" is. That would require explaining how to work your database. This is a rather large subject, and there's little chance of you reading my treatise on it when there's tons of info about databases on the net. It should suffice to say, your problem is a lot bigger than just editing one line of code. I'm looking at some fundamental problems with how that script is worked up, and is definitely beyond the scope of free help.

 

That is basically what mdshare meant, I think, although said far more concisely. ;)

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

I can understand that. But I am trying to learn and right now common sense is telling me that if i take the default code of the equip_armour.php and change so now its equip_hat.php and i edit all that applies to once was armor to hats then it should work.

I can understand us going back and forth and you feeling like you are doing all the work and i do not want that, i would love to learn how to do it myself. But spending hours of time reading and researching to find something that can be answered in a few posts seems to be a waste of time. I can understand that if im going to make this my career that would need to dedicate a lot more time to learning before i try but im not. Im doing this b/c i have some free time and want to see what i can do.

If you had no intentions on helping and only are looking for a pay check then please dont waste your time with my post Floydian.

It's just hard to try to learn something and when you get stuck you think you have over looked something stupid and when reach out to the community that knows what your trying to puts you down, then it makes you think whats the point of even trying or being a member to the community.

Yes i may copy and paste code but to me thats the real way for me to learn the best i need to load it up make changes and see the outcome. To see what i can and cant do first hand.

I may not be helpful now but im sure wants i can grasp more of the code i can be more of a crucial member to the same community that helped me out and to help out the ones that were just like me.

I'm pretty sure the boards are here to help people as well as give people a place come and show the amazing work they can do. Theirs just so much negativity on these boards, too many people to high strong to want to help. Maybe they are just tired of responding the the same posts over and over again to the same dumb copier and pastier.

Either way i feel bad that i even tried these boards for help. Like i said in the beginning i came here as my last resort...

Maybe CE is not a place for me to learn.

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

If you look over my posts, you'll see I help a lot of folks around here.

However, you're going to have to do some things in your database for this one to work properly, and without seeing the script, making sense of it, and going over a bunch of things with you, it wouldn't be possible for me to help you here. And like I said, this is beyond the scope (for me) of free support. No offense should be taken. If I had ignored your post, after having posted here once, perhaps that would be an offense, but that's were we stand.

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

I think you are trying to make this harder than what it really is and it sounds like you have a lack in knowledge about the mccode v2.

Anyone that knows where the code is pulling the information for the primary and secondary weapons and armor should be able to tell me the key parts that need to be update to lets say me adding in hats.

The request is not needing us to go through my database as if you had mccode v2 as well then you can easily look through yours saving all this wasted space in the posts.

I posted this in the mccodes for a reason, I'm looking for help from someone that knows what they are talking about it this particular area.

Please stop spamming my thread.

Thanks.

Link to comment
Share on other sites

Re: [mccode v2] inventory.php

Well after taking some time off from trying to fix this error and being frustrated. I realized what I did.

Floydian a field list is the list of fields within each table and i was missing the field equip_blank in the user table.

So without being a god awesome coder like yourself that requires people to read your BS when they are looking for help when they need it the most i was able to resolve the issue. Just takes some common sense about how coding works, a cool attitude and patience. As i learned from working to fast and missing a easy fix.

Sp1d3r

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