Jump to content
MakeWebGames

Recommended Posts

Posted

Hey all,

Can one you with your expert skills, help me out by making the following function work.

It currently loads the input area but doesn't submit...

 

function gang_staff_status(){global $db,$ir,$gangdata;if(isset($_POST['subm'])){$db->query("UPDATE gangs SET gangSTATUS={$_POST['vp']} WHERE gangID={$gangdata['gangID']}");print "Gang Status changed to {$gangdata['gangSTATUS']}";}else{print "<form action='yourgang.php?action=staff&act2=vicepres' method='post'>Enter the ID of the new vice-president.
<input type='hidden' name='subm' value='submit' />ID: <input type='text' name='vp' value='{$gangdata['gangSTATUS']}' maxlength='10' width='7' />
<input type='submit' value='Change' /></form>";}}

 

If someone could sort this out and post it for me, i would be grateful.

Posted

Why is the button invisible? and the input type has to be a submit, it cannot be hidden or itll act as hidden as far as i know

Posted

try this

function gang_staff_status(){
global $db,$ir,$gangdata;
if(isset($_POST['vp'])){
$db->query("UPDATE gangs SET gangSTATUS=".mysql_real_escape_string($_POST['vp'])." WHERE gangID={$gangdata['gangID']}");

print "Gang Status changed to ".$gangdata['gangSTATUS'];
}else{print "<form action='yourgang.php?action=staff&act2=vicepres' method='post'>Enter the ID of the new vice-president.
ID: <input type='text' name='vp' value='".$gangdata['gangSTATUS']."' maxlength='10' width='7' />
<input type='submit' value='Change' /></form>";}
}
Posted

this?

function gang_staff_status(){
global $db,$ir,$gangdata;
if(isset($_POST['vp'])){
$db->query("UPDATE gangs SET gangSTATUS='".mysql_real_escape_string($_POST['vp'])."' WHERE gangID='".$gangdata['gangID']."'");
echo mysql_error();
print "Gang Status changed to ".$gangdata['gangSTATUS'];
}else{print "<form action='yourgang.php?action=staff&act2=vicepres' method='post'>Enter the ID of the new vice-president.
ID: <input type='text' name='vp' value='".$gangdata['gangSTATUS']."' maxlength='10' width='7' />
<input type='submit' value='Change' /></form>";}
}
Posted

Now i'm getting

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Warring' WHERE gangID='24'', '/yourgang.php', unix_timestamp())' at line 2

Posted

no problem mate, try to find where your errors are loged, its much easier knowing what the error is rather then taling a stab in the dark

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.   Paste as plain text instead

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