I'm trying to insert some data to my our web database, but when Insert
the data, it inserts all the data from my form and ads two rows with no
data.
Can someone tell me what I'm doing wrong?
Here is the code:
<?php
include 'config.php';
include 'opendb.php';
$sql="INSERT INTO empresas (nombreempresa, nomcontacto, nit,
direccion, ciudad, pais, telefonofijo, fax, email1, email2, web,
casilla, observaciones) VALUES
('$nombreempresa','$nombrecontacto','$nit','$direccion','$ciudad','$pais','$telefono','$fax','$email1','$email2','$web','$casilla','$observaciones')";
mysql_query($sql) or die ("problema con query");
echo "<font color='#ff9a00'> Registro Insertado!!</font><br>";
$sq = "SELECT * FROM empresas";
$result = mysql_query($sq)or die ("problema Leyendo Tabla");;
echo "<table>";
echo "<tr><td>Nombre
Empresa</td><td>Nit</td><td>Direccion</td><td>Telefono</td></tr>";
while ($row=mysql_fetch_row($result)){
echo
"<tr><td>$row[3]</td><td>$row[4]</td><td>$row[5]</td><td>$row[8]</td></tr>";
}
echo "</table>";
include 'closedb.php';
?>
Regards
Marcelo Fabiani
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]