I'm trying to insert into DB but it doesn't
any ideas why?
<?php
function insertar ()
{
$con = mysql_connect ('','','') or die ("no conn");
@mysql_select_db ('aerosim') or die ("hey somth wrong");
$sql = "INSERT INTO vuelos (`vuelo`,`tipo`) VALUES ('$IBE','$tipo')";
mysql_query ($sql) or die (mysql_error ($con));
}
if ($vuelo = ""){
$vuelo=rand(1000,4000);}
else{
$vuelo = ($vuelo + rand(1000,5000));}
echo "IBE".$vuelo;
$IBE="IBE".$vuelo;
$tipo = "A330";
insertar($IBE, $tipo);
?>
an id and timestamp variables are written to the DB each time I refresh the page, but the variables from the script don't get written... so connection is ok, but variables are not getting there...
thanks!