drafting mysql statment. adding a var to a player deck, rem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jacebenson
Forum Newbie
Posts: 1
Joined: Sun May 08, 2005 1:44 am
Location: Monster Den

drafting mysql statment. adding a var to a player deck, rem

Post by jacebenson »

drafting mysql statment. adding a var to a player deck, removing hte card from the card pool.

I have a thing I am working on. Anyways.

This is what I need to do.

Code: Select all

if ($card_to_add){
$c = "UPDATE `decks` SET `main` = concat(main ,\"$HTTP_POST_VARS[card_to_add]\") WHERE player_id = \"$player_id\" ";
	$cquery = @mysql_query ($c);
	echo $c;
	if ($cquery){
		echo "Card Added<br>" . mysql_error();
		} else {
		echo "did not work, see error(s)<br><hr>" . mysql_error();
		}
}
if ($pack_id){
	$pu = "UPDATE `packs` SET `card_1` = \"\" WHERE pack_id = \"$pack_id\" ";
	$puquery = @mysql_query ($pu);
	if ($puquery){
		echo "card removed from db";
		} else {
		echo "card not removed" . mysql_error();
		}
}
instead of setting `card_1` i need to find that field has the variable in question

so say card_1 is King of Diamonds
and say person chose Ten of Spades which is in Field card_14
i need to removed all content form field card_14 in the pack.

I guess I don't know how to explain it. .thanks for at least reading if you kind of know what i am talkin bout give me an option..

d11wtq | Please read the sticky about posting code in the forums :-D
Post Reply