Jump to content

I need help bad


paulchain

Recommended Posts

OK here is what I'm trying to do I have 2 tables.  I need to have it where someone enters some information in on a website and it saves the name and amount as variables.  Then I need it to look at table 1 and search for that specific person's name that should be in the form of a variable due to the person previously entering it then on the same row copy their numerical id number into a variable.  Then go to table 2 and search for that person's numerical number by using the previous variable, locate it and add the amount that the person entered on the website to a column that we will call Amount.

 

Is this even possible if so how do I do this I cant find any information maybe due to me not knowing how to form the question. P.S. If you could please include examples to how to do this or something like it.

 

Thanks a ton,

 

Paul

Link to comment
Share on other sites

This is what I have so far I am extremly new to MySql and php so I know im doing something wrong lol

 

 

<?php

include 'config.php';

include 'opengamedb.php';

 

$name  = "SELECT name,id FROM players WHERE name='$_POST[charactername]'";

$name1 = mysql_query($name);

$name2 = "SELECT itemId,itemCount,itemOwner FROM inventory WHERE itemOwner='$name1'";

mysql_query("INSERT INTO inventory (itemCount)

VALUES ('_POST[kinah]'");

?>

Link to comment
Share on other sites

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.