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" Link to comment https://forums.phpfreaks.com/topic/15684-something-wrong/ 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] Link to comment https://forums.phpfreaks.com/topic/15684-something-wrong/#findComment-63977 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 Link to comment https://forums.phpfreaks.com/topic/15684-something-wrong/#findComment-63979 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.