Jump to content
MakeWebGames

KyleMassacre

Members
  • Posts

    2,921
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by KyleMassacre

  1. There is much more than that. You will need to follow the conversion from v1 to v2 tutorial and also add $db as a global in every function
  2. Then your items are not set up correctly
  3. Dont upload the whole file but I am curious to what you have tried
  4. Run that query in your PHPMyAdmin and see what shows up.
  5. Ok change the $_POST['ID'] to $_GET['ID'] and anywhere you see $_GET['id'] to $_GET['ID'] anywhere you see in the file
  6. The first thing we are going to is try: Replace this $q=$db->query("SELECT iv.*,i.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid WHERE i.itmid={$_GET['id']} AND i.itmtype=15 AND iv.inv_userid=$userid"); if($db->num_rows($q)==0) { print "This item is not a Gun! <a href='inventory.php' class='button'>Exit</a>"; } with this $q=$db->query("SELECT iv.*,i.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid WHERE i.itmid={$_POST['ID']} AND i.itmtype=15 AND iv.inv_userid=$userid"); if($db->num_rows($q)==0) { print "This item is not a Gun! <a href='inventory.php' class='button'>Exit</a>"; echo "<pre>".$db->last_query."</pre>"; } And report back what it says
  7. Well hit me up when you get online
  8. Correct which was why I posted the little snippet to show the main difference between the two
  9. Paste up exactly what you have so far
  10. Ok, thats fine. The difference between GET and POST is that they are 2 different HTTP methods and to put it as simple as possible, they get their data from 2 different locations. POST gets its data generally from a form, I believe you have seen things along the lines of: <form action='somepage.php' method='post'> .... </form> And the key names for your POST variables come from the name of your inputs: <form action='somepage.php' method='post'> <input type='text' name='username' value=''/> </form> From there you are able to use $_POST['username']. You are able to use any HTTP method inside your form but usually you use post and not get because thats just dumb :p. You can learn more by google what CRUD is (Create, Read, Update, Delete). For GET, it gets the data from the URL (which is why I asked what your URL looked like before) which is called a query string. So for example: index.php?action=someAction&type=someType So now you have access to $_GET['action'] and $_GET['type']: $_GET['action'] = someAction $_GET['type'] = someType So hopefully this helps you debug your problem a bit more
  11. Agreed, but I wasn't even talking about that. I was more on the ctype* and trim
  12. Quick question, I know you are beginning but are you aware of the differences between $_POST and $_GET? Because it seems to me that some of your $_POST data actually needs to be $_GET
  13. Its basically bare minimum mysqli
  14. When you go to purchase the ammo and it says this is not a gun, what is the URL that you are at?
  15. A little overkill on it much haha. The switch statement will handle most of the security you provided by going to the default if it's not one of the cases defined right? FYI.... I moved this to a new topic from here: http://makewebgames.io/forum/general-development-central/services/24426-free-mysql-to-mysqli-conversion
  16. I don't know if the issue is that you have $_POST['ID'] and $_POST['id'] mixed together or not but you can try finding all the lowercase ones and making them uppercase
  17. Is the item's type 15 in the database?
  18. Can you start a new topic because this is going way off topic and I can't figure out for the life of me how to split this on my phone. And I am at work. When I get a chance after work I will merge all of these into that new topic
  19. An array is a dictionary of keys/indexes and their values. It's basically a multi-dimensional variable. This is pretty much exactly why you need to check your arrays before using them for example: $data = array( 'index1' => 10, 'index2' => 5, ); echo $data['index3']; // will result in an error 'undefined index index3 (6)' $data['index3'] = 1; echo $data['index3']; // will return 1 These errors can easily be avoided by using things such as isset() or array_key_exists() but these are different: http://codepad.org/SDsWmLmq
  20. There is a clear definition since I have told you how at least 3 times ;) I don't want to tell you exactly how to do it because you won't learn
  21. No I can't somehow I messed it up
  22. A production environment generally means it's open to the public. A development environment generally means it's done locally. Just because no one knows your URL doesn't mean they can't get to it. If people do get to it then they could exploit your system and retrieve your database information
  23. It's not a variable it's an array key also known as an array index
  24. Yeah the new bbcode software here really sucks now
  25. It should work pretty well. I don't think MCC uses that much deprecated/obsolete functions going from 5.6 Here is something to look at: http://php.net/manual/en/migration70.php
×
×
  • Create New...