Jump to content
MakeWebGames

Ammo


Guest Sniko`

Recommended Posts

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

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:

You're unable to view this code.

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

And the key names for your POST variables come from the name of your inputs:

You're unable to view this code.

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

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

Link to comment
Share on other sites

Sorry, internet has been down most of the day.

 

A critical error has occurred, and page execution has stopped. Below are the details:

1064: 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 'AND i.itmtype=15 AND iv.inv_userid=1' at line 1

Action taken: Attempted to execute query: SELECT iv.*,i.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid WHERE i.itmid= AND i.itmtype=15 AND iv.inv_userid=1

Link to comment
Share on other sites

I've managed to be able to successfully process the itm to allow to see the purchase form, but after entering a clip number it again returns this item is not a gun rather than updating the database with clips. Here is the code so far

 

You're unable to view this code.

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

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.


×
×
  • Create New...