ID:276022
 
    $page_content = "It worked.";
$page_creator = "Ryan";
$page_date = date("Y-m-d H:m:s");
$page_name = "HomePage";
$makepage = "INSERT INTO `RyeWicki` ('name','content','creator','date') VALUES ($page_name,$page_content,$page_creator,$page_date)";


There seems to be something wrong with $makepage (the query). Does anyone see anything wrong with it?

-Ryan
Whats it doing wrong?
In response to Smoko
Not working.

-Ryan
In response to Ryne Rekab
Does it give you an error, or does it just not insert what you want it to?
In response to Smoko
Just doesn't insert...

    $page_content = "It worked.";
$page_creator = "Ryan";
$page_date = date("Y-m-d H:m:s");
$makepage = "INSERT INTO `RyeWicki` ('name','content','creator','date') VALUES ($page_name,$page_content,$page_creator,$page_date)";
$R = mysql_query($makepage);
if($R) {
$query = "SELECT * FROM `RyeWicki` WHERE name=`".$page_name."`";
$result = mysql_query($query);
if ($row = msql_fetch_array($result)) {
$made_page = $row["creator"];
echo $made_page." made this page.";
echo "<hr>";
echo $row["content"];
}
}
else {
echo 'Error 404';
}


It always returns 'Error 404'. :|

-Ryan
In response to Ryne Rekab
$query is your problem. You're setting it to:
"INSERT INTO `RyeWicki` ('name','content','creator','date') VALUES ($page_name,$page_content,$page_creator,$page_date)"


Which (assuming that you did a $page_name = "Cool"; ) evaluates to:
"INSERT INTO `RyeWicki` ('name','content','creator','date') VALUES (Cool,It worked.,Ryan,2005-04-08 12:04:22)"

Which is clearly invalid, since your strings are not in quotes. ("Ryan" instead of Ryan). So put double or single quotes around string values!

Another suggestion: Forget date() --- the 'date' column in your table is hopefully of a DATETIME type, in which case you could simply pass NOW() as it's value. (MySQL evaluates that to the current time. (Note: Can cause weird things if your database's time != web host's time))

And finally, your echo "Error 404" is quite misleading, the page is probably returning a 200. What would be better is a echo mysql_error(), so that you can see what went wrong.

So, what you probably want is:
"INSERT INTO `RyeWicki` ('name','content','creator','date') VALUES ('$page_name','$page_content','$page_creator',NOW())"

--- depending on how you set up your table, NOW() might be '$page_date' if you didn't make that column a DATETIME.

Hope that helps!
-Nova
In response to Nova2000
Thanks a lot. I will go right now and see how it works!

Thanks-

-Ryan