Im Puzzled By this error, happens when i add an entry
Unknown column '(inputted title)' in 'field list'
Heres The relevant Code
i Should Explain How My Blog Works...PHP Code:-----------Catches Data------------------
if ($_POST["post_user"] != "") {
$user = $_POST[post_user];
$pass = $_POST[post_pass];
$title = $_POST["post_title"];
$entry = $_POST["post_entrys"];
$statement = "INSERT INTO `$user` ( `title` , `entry` ) VALUES ( `$title` , `$entry` )";
login( $statement , $user , $pass );
echo" Entry added";
} else { echo"Input Username"; };
---------------Login Function--------------
function login($action , $user , $password) {
$userInfo = mysql_query("SELECT * FROM `login` where `user`='$user'");
if (!mysql_num_rows($userInfo)) {echo 'No such user!';}
else {
$q = mysql_fetch_array($userInfo);
if ($password != $q[password]) {echo 'wrong password';}
else { mysql_query($action) or die(mysql_error()); echo"Query Successful:"; };
}; };
i typed up an entire paragraph, looked at it for a bit, then decided to just list the junk.
Include.php
- Contains Doctype, head section
- Connects To Database, Defines The Login Function
- includes menu.php
Menu.php
- Contains layout
- left column links to the root, registration page, and the pages to add entries and change your css.
- Right Column lists users
- middle column contains different junk depending on the page.
index.php
- Includes include.php
- has different pages that Adds Entries
- Adds Users
- Changes Personal CSS
action.php handels the data from index.php's forms
Display.php interprets the bbcode,then displays the blog of "$_GET[un]" EG display.php?un=boxxertrumps



Reply With Quote



Bookmarks