R4nk3d Posted October 21, 2008 Share Posted October 21, 2008 if($_GET['type'] == "page" && isset($id)) { $sql = "SELECT * FROM links WHERE 'id'='$id'"; $result = mysql_query($sql,$connection); $rows = mysql_num_rows($result); if($rows == 1) { while($r = mysql_fetch_array($result)) { echo "<h1>Edit: News: ID $r[id]</h1>"; echo "Please use the editor below to format the page. To insert a special type of text, please click the button."; echo "<br>"; echo "<form id=\"pagecode\" name=\"pagecode\" method=\"post\" action=\"edit.php?type=page&id=$id&submitting=1\">"; echo "<input name=\"header\" type=\"button\" onclick=\"insertCode('<h1></h1>','pagebody');\" value=\"Header\" />"; echo "<input name=\"nl\" type=\"button\" onclick=\"insertCode('<br>','pagebody');\" value=\"New Line\" >"; echo "<br />"; echo "<textarea name=\"pagebody\" id=\"pagebody\" cols=\"80\" rows=\"10\">".$r['news']."</textarea>"; echo "<br />"; echo "<input name=\"submit\" id=\"submit\" onclick=\"checkconfirm('pagecode'); return false;\" type=\"button\" value=\"Submit\" />"; echo "</form>"; } } else { echo "<h1>Edit: Page: ID Not Found</h1>"; echo "The page id you have searched for cannot be found. Please try again."; } } I am using this code to make a small cms. But the problem is, even tho the id exists in the database and you can view it on the page that shows its body, it says on this page it does not exist and i cannot figure out why its not working. can anyone help? Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted October 21, 2008 Share Posted October 21, 2008 change this $sql = "SELECT * FROM links WHERE 'id'='$id'"; to this $sql = "SELECT * FROM links WHERE id = '$id'"; Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 21, 2008 Author Share Posted October 21, 2008 change this $sql = "SELECT * FROM links WHERE 'id'='$id'"; to this $sql = "SELECT * FROM links WHERE id = '$id'"; Ur a life saver Thank you a ton. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted October 21, 2008 Share Posted October 21, 2008 naw i just like to help when I can 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.