double query
Posted: Wed Jun 04, 2003 7:54 am
i have a button that when clicked will approve a user by changing a field in a database. I have some forums and as i'm having trouble tying the 2 logins together i'm trying to set it so that when admin approves a member it will add them to the forum database so they can log onto the forum.
First when i was just approving them i had
which worked fine. Now i've changed it to
#]
Whilst i get no errors it also isn't adding the user to the forums
First when i was just approving them i had
Code: Select all
<?php
if (isset($_POST['userapp']))
{
$userapp = "UPDATE users set approved = '1' where username = '$_POST[useredit]'";
$resultapp = mysql_query($userapp, $db_conn) or die("query [$query] failed: ".mysql_error());
}
?>Code: Select all
<?php
if (isset($_POST['userapp']))
{
$userapp = "UPDATE users set approved = '1' where username = '$_POST[useredit]'";
$resultapp = mysql_query($userapp, $db_conn) or die("query [$query] failed: ".mysql_error());
$addtoforum = "SELECT * FROM users where username = '$_POST[useredit]'";
$add1 = mysql_query($addtoforum, $db_conn) or die("query [$query] failed: ".mysql_error());
$row = mysql_fetch_assoc($addl);
$fuser = $row['username'];
$fname = $row['username'];
$fpass = $row['passwd'];
$fmail = $row['email'];
if ($row==1)
{
$adduser = "INSERT INTO forum_auth (name,username,password,email) VALUES ('$fname','$fuser','$fpass','$fmail')";
$done = mysql_query($adduser, $db_conn) or die("query [$query] failed: ".mysql_error());
}
}
?>Whilst i get no errors it also isn't adding the user to the forums