i am trying to erase this " [" Conexion exitosa a la base de datos! " using the block replace all text segment replecement. this is my blocks
in this block i am getting the column result but i only erase the line " [" Conexion exitosa a la base de datos! " and i dont know why its not working using the block all text segment replacement for replace for " " the line of the text " [" Conexion exitosa a la base de datos! "
WHen you receive JSON in a response content, use the Web block to parse it using JSON dictionaries, then apply list and dictionary blocks to extract what you need.
<?php
// Juan Antonio Villalpando
// juana1991@yahoo.com
// http://kio4.com
// https://kio4.000webhostapp.com/mysqli_post.php
// 1.- IDENTIFICACION nombre de la base, del usuario, clave y servidor
// 2.- CONEXION A LA BASE DE DATOS
include_once "pruebaconexionwebhost.php"; // Incluir el archivo con la conexión a la base de datos
$boton = $_POST['boton'];
/////////////////////////////// INSERTAR - INSERT ////////////////////////////////////
if ($boton == "btnInsertar"){
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$telefono = $_POST['telefono'];
$query="INSERT INTO clientes (nombre, email, telefono) VALUES ('$nombre','$email','$telefono')";
$result = mysqli_query($link, $query);
print("Datos agregados a la base.");
mysqli_close($link);
}
/////////////////////////////// BORRAR - DELETE ////////////////////////////////////
if ($boton == "btnBorrar"){
$Nombre = $_POST['nombre'];
$query="delete from clientes where nombre='$nombre'";
$result = mysqli_query($link, $query);
print("Datos borrados.");
mysqli_close($link);
}
////////////////////////////// ACTUALIZAR - UPDATE ///////////////////////////////
if ($boton == "btnActualizar"){
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$telefono = $_POST['telefono'];
$query="update personas set email='$email', telefono='$telefono' WHERE nombre='$nombre'";
$result = mysqli_query($link, $query);
print("Datos modificados.");
mysqli_close($link);
}
///////////////////// BUSCAR POR NOMBRE - SEARCH BY NAME /////////////////////////////
if ($boton == "btnBuscarNombre"){
$nombre=$_POST['nombre'];
$hacer = mysqli_query ($link, "SELECT * FROM clientes WHERE nombre='$nombre' ");
enviar_respuesta($hacer);
}
/////////////////////// MOSTRAR TABLA - SHOW TABLE /////////////////////////////////////
if ($boton == "btnVerTabla"){
$hacer = mysqli_query ($link, "SELECT * FROM clientes");
enviar_respuesta($hacer);
}
/////////////////////// OBTENER ORDENADO - GET SORT /////////////////////////////////////
if ($boton == "btnOrdenar"){
$Columna = $_POST['Columna'];
$hacer = mysqli_query ($link, "SELECT * FROM clientes ORDER BY $Columna ASC");
enviar_respuesta($hacer);
}
////////////////////////////// RESPUESTA - RESPONSE ///////////////////////
// En los casos que hay btnBuscarNombre o btnVerTabla y se debe enviar una respuesta actúa este código.
function enviar_respuesta($hacer)
{
$resultado = mysqli_query($GLOBALS['link'], "SHOW COLUMNS FROM clientes");
$numerodefilas = mysqli_num_rows($resultado);
if ($numerodefilas > 0) {
$en_csv='';
while ($rowr = mysqli_fetch_row($hacer)) {
for ($j=0;$j<$numerodefilas;$j++) {
$en_csv .= $rowr[$j].", ";
}
$en_csv .= "\n";
}
}
print $en_csv;
}
///////////////////////////////////////////////////////////////////
?>