Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/07/2015, 09:44
diegoguerrero
 
Fecha de Ingreso: diciembre-2014
Ubicación: Madrid
Mensajes: 274
Antigüedad: 9 años, 4 meses
Puntos: 5
Falla la ejecución del INSERT

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /Applications/XAMPP/xamppfiles/htdocs/sastre/nuevo.php on line 4

Falla algún carácter pero no sé qué es. Además, si me decís si el siguiente código está bien lo agradezco.
Código PHP:
<?php
$mysqli 
= new MySQLi('localhost''root''''AppSastre');
$sql "INSERT INTO pedidos (cliente, prenda, precio)
VALUES ($_POST['cliente'], $_POST['prenda'], $_POST['precio']"
);
?>
<html>
<head>
<meta charset="utf-8"/>
<link href="css/css.css" rel="stylesheet"/>
<title>Crear</title>
</head>
</html>
<?php
if ($_POST){
    echo 
'<h1 align="center">FALLIDO</h1>';
}else{
    echo 
'<table align="center" width="30%" border="0">
<form action="nuevo.php" method="post">
<tr>
<td align="center">    
<input type="text" id="camposTexto" name="cliente" placeholder="Cliente"/>
</td>
</tr>
<tr>
<td align="center">
    <input type="text" id="camposTexto" name="prenda" placeholder="Prenda"/>
</td>
</tr>
<tr>
<td align="center">
    <input type="text" id="camposTexto" name="precio" placeholder="Precio"/>
</td>
</tr>
<tr>
<td align="center">
    <input type="submit" value="Crear" id="boton"/>
    </form>
    </td>
    </tr>
    </table>
'
;
}
?>