ok so this is probably so basic, but ive tried a few things and its stil throwing the error. it wont insert the data thats coming from a form (the forms using $PHP_SELF). it echoes "connection failed"($selectdb). heres the script.
mysql_connect("localhost","user","pass");
$query = "INSERT INTO userfiles (filename,filedesc,filedate,uid) VALUES ($filename_ff,$filedesc_ff,CURDATE(),$uid)";
$selectdb = mysql_db_query("flashbox",$query);
if (!$selectdb) {
echo "connection to the database has failed";
}
i was thinkin the prob might be with my values...should they all have quotes around them?
am i doing CURDATE() right?
do all my column names in my table need to be represented in my "insert code" ?
heres the column names in my mysql table...
id | filename | filedesc | filedate | uid
id and uid are int and id is auto_increment (uid is not).
if you could maybe give me a few rules or pointers on this mysql command it would help alot. thank you.
mysql_connect("localhost","user","pass");
$query = "INSERT INTO userfiles (filename,filedesc,filedate,uid) VALUES ($filename_ff,$filedesc_ff,CURDATE(),$uid)";
$selectdb = mysql_db_query("flashbox",$query);
if (!$selectdb) {
echo "connection to the database has failed";
}
i was thinkin the prob might be with my values...should they all have quotes around them?
am i doing CURDATE() right?
do all my column names in my table need to be represented in my "insert code" ?
heres the column names in my mysql table...
id | filename | filedesc | filedate | uid
id and uid are int and id is auto_increment (uid is not).
if you could maybe give me a few rules or pointers on this mysql command it would help alot. thank you.