sql >> Base de Datos >  >> RDS >> Mysql

MySQL INSERT INTO con PHP $variable

Puedes usar así

mysql_query("INSERT INTO `$person` VALUES(...) ")
or die(mysql_error());

Has cerrado el if y else mal

solo puedes probar esto

$sql = 'INSERT INTO `name`(date, min, sec, count, temp, universal)
        VALUES("'.$date.'", "'.$min.'", "'.$sec.'", "'.$count.'", "'.$temp.'", "'.$universal.'")';

$sql = 'INSERT INTO $person (date, min, sec, count, temp, universal)
    VALUES("'.$date.'", "'.$min.'", "'.$sec.'", "'.$count.'", "'.$temp.'", "'.$universal.'")';
    if(!mysql_query($sql)) {
    echo '<center><p><b>ERROR!</b></p></center>';
    }else{ 
    echo '<center><p><b>Its okay</b></p></center>';
    }
    }// so where this comes from ?