desithugg Posted July 26, 2006 Share Posted July 26, 2006 [code]<?phpmysql_connect("localhost", $my_sql_password, $my_sql_username) or die("Could not connect: " . mysql_error());mysql_select_db("tpf");$result = mysql_query("SELECT soldto FROM sold where id = '$item_id'");if (!$result) { echo 'Could not run query: ' . mysql_error(); exit;}$row = mysql_fetch_row($result);$sold_for = $row[0];?><?if ($sold_for = "all") { $sold_for = $user_logged_in; }else{$sold_for = $sold_for;}?><?PHPif ($sold_for != $user_logged_id){ echo "<center>Access Denied<br>Sorry this item is not meant to be sold to you."; exit(); }?>[/code]umm my username is "Desithugg" and the item is sold for "Deadman" but when i go to the page it doesnt give me the error that the item is not meant to be sold for me.umm im not sure why and yes i did try removing the "()" after the "exit" Quote Link to comment Share on other sites More sharing options...
Chips Posted July 26, 2006 Share Posted July 26, 2006 [quote][code]if ($sold_for = "all") { $sold_for = $user_logged_in; [/code][/quote]The sold_for = that's assignment, NOT equality checking. Use a double ==[code]($sold_for == "all")[/code] Quote Link to comment Share on other sites More sharing options...
desithugg Posted July 26, 2006 Author Share Posted July 26, 2006 lol thanx i looked over that atleadst 20 times and didn't catch it.anyways thnx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.