Jump to content

Calling This!


Dethman

Recommended Posts

Hello Im trying to Call this:

 	if (isset($_POST['mypath'])) {
  	$choice = $_POST['loyalty_choice'];
	$sql = "UPDATE `user_users` SET `loyalty` = '$choice' WHERE `userid` = '{$user['userid']}'"; 	
		header ('Location: worship.php?str=Your Path Has Been Chosen!');
	}

 

When you use this:

<form name="loyalty" action="" method="post">
            <select name="loyalty_choice">
           	 <option value="0" selected >Choose Your Path</option>
             <option value="1"  >Chaos</option>
             <option value="2"  >Order</option>
             <option value="3"  >Life</option>
             <option value="4"  >Death</option>
            </select>
            <input type="submit" name="mypath" value="Worship This Caste!">
</form>

It dosnt update the SQL DB

Link to comment
https://forums.phpfreaks.com/topic/98954-calling-this/
Share on other sites

you forgot mysql_query

 

this

$sql = "UPDATE `user_users` SET `loyalty` = '$choice' WHERE `userid` = '{$user['userid']}'"; 	

 

should be

 

$sql = "UPDATE `user_users` SET `loyalty` = '$choice' WHERE `userid` = '{$user['userid']}'"; 	
mysql_query($sql) or die("Cannot Execute:".mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/98954-calling-this/#findComment-506318
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.