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
https://forums.phpfreaks.com/topic/193496-i-need-help-bad/
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
https://forums.phpfreaks.com/topic/193496-i-need-help-bad/#findComment-1018702
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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