Cannot save variable type of date
Posted: Fri Jan 22, 2010 5:49 pm
Hi
I need to save one variable type date in mysql table but i can't. Please look at the code and help me, please:
$data_compra=date($_POST['data_compray']."/".$_POST['data_compram']."/".$_POST['data_comprad']);
print $data_compra;
//acesso à base de dados
$mysql_id = mysql_connect('localhost', "curso", "123");
mysql_select_db('mariolopes',$mysql_id);
$query="insert into negocios (Codigo,Data_compra)values('Tobias',$data_compra)";
$result=mysql_query($query);
$data_compra is my variable type of date. If I can have date in european format is better (dd/mm/yy) for my project.
Thank you
I need to save one variable type date in mysql table but i can't. Please look at the code and help me, please:
$data_compra=date($_POST['data_compray']."/".$_POST['data_compram']."/".$_POST['data_comprad']);
print $data_compra;
//acesso à base de dados
$mysql_id = mysql_connect('localhost', "curso", "123");
mysql_select_db('mariolopes',$mysql_id);
$query="insert into negocios (Codigo,Data_compra)values('Tobias',$data_compra)";
$result=mysql_query($query);
$data_compra is my variable type of date. If I can have date in european format is better (dd/mm/yy) for my project.
Thank you