FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Problem creating new table and inserting





Saysior
Code:
<html>
<head>
</head>
<body>
<img src="saysiorbanner.jpg" width="100%">
<?php
$title = $_POST['title'];
$type = $_POST['type'];
$content = $_POST['content'];
$password = $_POST['password'];
$docname = $_POST['docname'];
$date = date("Y/m/d");
$summary = $_POST['summary'];
$comments = $_POST['comments'];
$con = mysql_connect("localhost", "*******", "******");
mysql_select_db("********", $con) or die(mysql_error());
$ins = mysql_query("INSERT INTO documents (title, type, date, content, docname, summary, comments) VALUES ($title, $type, $date, $content, $docname, $summary, $comments)");
mysql_close($con);
if ($ins) {
echo "<br><br><br><center>Nice work.  " . $title . " has been uploaded and is now available for the public to view.";
}
else {
echo "There was a problem";
}
?>
</body></html>


I've been tweaking this code for a while and I can't get it to work. What really bugs me is that I've written stuff like this before, so I have no idea why I can't get it to work now. Would anyone who can please tell me where I went wrong with this? $ins has been returning false, and I've looked at my database records. Thank you so much in advance.


EDIT: I found some old code that does what I want this code to do, and it works, so I no longer have a problem.
coreymanshack
the documents table doesn't exist yet?
Saysior
No, I specifically created it. But I've found some old script I wrote a while back that did essentially the same thing. I can't figure out the difference, but this one works, so help is no longer needed. Thank you very much anyways.
Related topics
Make New Users Read Sticky's before creating new topics
Problem with static variable in class
Can't create mySQL table
Access DataBase using visual basic6
a new mysql table...
Problem with New VLC media Player
Can't create new table.
MYSQL Normalization double join
FTP User Pass Invalid?
image gallery: suggesions reqd
[HELP] PHP -> Scripting
CSS Help...
What is wrong with this MySQL query?
PHP.ini
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.