Hello
I'm trying to create a form that will insert a joke to a database which already belongs to another joke script.
If a user enters the joke through the joke script, all the data, including the date, will be entered correctly to the database.
In my form, everything is written correctly to the database, exept for the date.
I've tried almost everything, such as storing the date function in a variable, and trying to insert the variable into the database, but i just can't get it to work.
The tricky thing is, that the original joke script uses the now() function to insert the date, and it seems to work fine, but when i use the now() function, the letters "now()" are stored and the date is not.
My little script is here:
<?php
// Make a MySQL Connection
mysql_connect("localhost", "runilo_mamb1", "password") or die(mysql_error());
mysql_select_db("runilo_mamb1") or die(mysql_error());
// Insert a row of information into the table "example"
mysql_query("INSERT INTO jokesite_jokes
(name, joke_title, joke_text, category_id, joke_type, rating_value, validate, slng, date_add) VALUES('$name', '$joke_title', '$joke_text', '$category_id', 'mini', '0', '1', '_eng', 'NOW()' ) ")
or die(mysql_error());
echo "Data Inserted!";
?>
And the INSERT INTO lines of the joke script are here:
bx_db_insert($database_table_name3 ,"category_id,name,email,joke_text,joke_type".($use_censor == "yes" ? ",censor_type" : "").",date_add,validate,joke_title,slng", "'".$HTTP_POST_VARS['joke_category']."','".bx_dirty_words($HTTP_POST_VARS['sender_name'])."','".bx_dirty_words($HTTP_POST_VARS['sender_email'])."','".bx_dirty_words($HTTP_POST_VARS['joke_text'])."','".$joke_type."'".($use_censor=="yes" ? ",'".$HTTP_POST_VARS['censor_category']."'" : "").",now(),'".($need_joke_validation=='1' ? "0" : "1")."','".bx_dirty_words($HTTP_POST_VARS['joke_title'])."','".$slng."'");
SQL_CHECK(0,"SQL Error at ".__FILE__.":".(__LINE__-1));
I'm not very savvy when it comes to php programming, but to me it seems that my now() function is not being executed, and i don't know how to port the now function from the joke script, to my script.
Anybody like to help out a bit? Any help is much appreciated