mikelmao Posted August 6, 2008 Share Posted August 6, 2008 I made a small system wich updates users info.. Well it wont go in the DB .. .. Whts my what can i do :/? (CODE:) <?php include 'connect.php'; if(isset($_SESSION['admin'])) { if($_SERVER['REQUEST_METHOD'] == 'POST') { mysql_query("UPDATE users SET `order`='". $_POST['ord'] ."' AND `admin`='". $_POST['admin'] ."' WHERE id='". $_POST['idz'] ."'") or die("Mysql Query Error: " . mysql_error()); echo "User: ". $_POST['unamez'] .". Please wait to be redirected."; echo "<meta http-equiv=Refresh content=3;url='info.php'>"; } else { $a = mysql_query("SELECT * FROM users WHERE id=". $_GET['user'] .""); while($r = mysql_fetch_array($a)) { echo "<form action='edit.php' method='post'> <input type='hidden' name='idz' value='". $_GET['user'] ."'> Username: <input type='text' name='unamez' value='". $r['uname'] ."' readonly><br> Order: <select name='ord'> <option value='0'>Pending</option> <option value='1'>Approve</option> <option value='2'>Decline</option> </select><br> Power: <select name='admin'> <option value='0'><font color='orange'>Normal User</font></option> <option value='1'><font color='green'>Admin</font></option> </select><br> <input type='submit' value='Update User'>"; } } } else { echo "You need to be admin to view this page."; } ?> Link to comment https://forums.phpfreaks.com/topic/118491-solved-uknown-error/ Share on other sites More sharing options...
NathanLedet Posted August 6, 2008 Share Posted August 6, 2008 <input type='hidden' name='idz' value='". $_GET['user'] ."'> can you echo that out and tell us what that says? I'm thinking, if you switch up your quotes for the value, that may help. <input type='hidden' name='idz' value="'. $_GET['user'] .'">; Link to comment https://forums.phpfreaks.com/topic/118491-solved-uknown-error/#findComment-609995 Share on other sites More sharing options...
mikelmao Posted August 6, 2008 Author Share Posted August 6, 2008 nope And it echo's the id of the user in the URL.. So its does what its supose to.. Link to comment https://forums.phpfreaks.com/topic/118491-solved-uknown-error/#findComment-610004 Share on other sites More sharing options...
Jabop Posted August 6, 2008 Share Posted August 6, 2008 You shouldn't post the same question in multiple forums. You could start by not just saying 'help it won't work what do i do.' Show us your error message. Link to comment https://forums.phpfreaks.com/topic/118491-solved-uknown-error/#findComment-610023 Share on other sites More sharing options...
mikelmao Posted August 6, 2008 Author Share Posted August 6, 2008 there is no error :/ Link to comment https://forums.phpfreaks.com/topic/118491-solved-uknown-error/#findComment-610026 Share on other sites More sharing options...
Jabop Posted August 6, 2008 Share Posted August 6, 2008 mysql_query("UPDATE users SET `order`='". $_POST['ord'] ."',`admin`='". $_POST['admin'] ."' WHERE id='". $_POST['idz'] ."'") or die("Mysql Query Error: " . mysql_error()); Link to comment https://forums.phpfreaks.com/topic/118491-solved-uknown-error/#findComment-610033 Share on other sites More sharing options...
timmah1 Posted August 6, 2008 Share Posted August 6, 2008 Why not just write this mysql_query("UPDATE users SET `order`='". $_POST['ord'] ."' AND `admin`='". $_POST['admin'] ."' WHERE id='". $_POST['idz'] ."'") or die("Mysql Query Error: " . mysql_error()); as this mysql_query("UPDATE users SET `order`='". $_POST['ord'] ."', `admin`='". $_POST['admin'] ."' WHERE id='". $_POST['idz'] ."'") or die("Mysql Query Error: " . mysql_error()); Link to comment https://forums.phpfreaks.com/topic/118491-solved-uknown-error/#findComment-610034 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.