
18/06/2011, 13:37
|
| | Fecha de Ingreso: mayo-2010
Mensajes: 414
Antigüedad: 14 años, 9 meses Puntos: 2 | |
Respuesta: reemplazar datos mysql Ya encontre el error al final me quedo así!
<?php
$texto=$_POST["texto"];
$idioma=$_POST["idioma"];
$tipo=$_POST["tipo"];
include ("../configuracion/conexion-usuario.php");
include("conexion.php");
$orden="SELECT * FROM textos WHERE idioma='$idioma' AND tipo='$tipo'";
$rs=mysql_query($orden, $conn);
if (mysql_num_rows($rs)!=0){
$orden2="UPDATE textos SET texto = '$texto' WHERE idioma='$idioma' AND tipo='$tipo'";
$rs2=mysql_query($orden2, $conn) or die(mysql_error());
}else {
$orden2="INSERT INTO textos (texto, tipo, idioma) values ('$texto', '$tipo', '$idioma')";
$rs2=mysql_query($orden2, $conn) or die(mysql_error());
}
?>
GRACIAS POR LAS RESPUESTAS!!! |