Help with saving a color
Posted: 11 Jul 2014, 00:36
Something's wrong with my code when saving an item. I not sure what is wrong. Can someone please help!!!! I'm new to this.
PHP:
<?php
mysql_connect("host","user","pass") or die();
mysql_select_db("database name") or print "word=Failed.&checklog=2";;
$usercheck = $_POST['username'];
$result = mysql_query("UPDATE users SET Color = '1' WHERE username='$usercheck' ");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
Flash:
on (release) {
var newCol = 9;
_root.smartfox.setUserVariables({col:newCol, init:true});
_root.myAvatar.disc.gotoAndStop(newCol);
_root.whatColor = 9;
if (_root.username != "") {
loadVariablesNum("itemsave.php", 0, "POST");
_root.word = "Begin saving process";
}else{
_root.word = "Error";
}
_root.closeColor();
}
Also tested the MySQL by updating a user and it worked (Using the code, UPDATE users SET Color = '1' WHERE username='Test')
Thanks.
PHP:
<?php
mysql_connect("host","user","pass") or die();
mysql_select_db("database name") or print "word=Failed.&checklog=2";;
$usercheck = $_POST['username'];
$result = mysql_query("UPDATE users SET Color = '1' WHERE username='$usercheck' ");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
Flash:
on (release) {
var newCol = 9;
_root.smartfox.setUserVariables({col:newCol, init:true});
_root.myAvatar.disc.gotoAndStop(newCol);
_root.whatColor = 9;
if (_root.username != "") {
loadVariablesNum("itemsave.php", 0, "POST");
_root.word = "Begin saving process";
}else{
_root.word = "Error";
}
_root.closeColor();
}
Also tested the MySQL by updating a user and it worked (Using the code, UPDATE users SET Color = '1' WHERE username='Test')
Thanks.