Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/09/2012, 02:19
arlene90
 
Fecha de Ingreso: septiembre-2012
Mensajes: 103
Antigüedad: 11 años, 7 meses
Puntos: 0
Respuesta: Like en dreamweaver php

este es el codigo de la busqueda donde deseo hacer el lik, se los agradezco de antemano con una pequeña idea me basta o alguna pagina, porque busque en el foro pero solo con asistente encontre y asi no lo necesito

<?
error_reporting(0);
?>
<?php require_once('Connections/prematricula.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}



$guardasigla = $_POST['consigla'];
$guardanombre = $_POST['connombre'];



mysql_select_db($database_prematricula, $prematricula);
@mysql_query("SET NAMES 'utf8'");
$query_Recordset1 = "SELECT nucleos.id_nucleo, nucleos.sigla_nucleo, nucleos.nombre_nucleo, nucleos.descripcion_nucleo FROM nucleos WHERE sigla_nucleo LIKE '%$guardasigla%' OR nombre_nucleo LIKE '%$guardanombre%' ";
$Recordset1 = mysql_query($query_Recordset1, $prematricula) or die(mysql_error());
$Recordset2 = mysql_query($query_Recordset1, $prematricula) or die(mysql_error());



$id_nucleo=$row_Recordset1['id_nucleo'];
?>






<div class="AreaPrincipal">
<div align="left"><!-- InstanceBeginEditable name="EditRegion3" -->

<div id="content2">

<span class="Letras"> Actualizar Núcleos</span>
<hr />
<form action="<?php echo $editFormAction; ?>" method="post" name="form2" id="form2">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Sigla:</td>
<td><input name="consigla" type="text" id="consigla" value="" size="20" /></td>
<td nowrap="nowrap" align="right">Nombre:</td>
<td><input name="connombre" type="text" id="connombre" value="" size="20" /></td>

<td><input type="submit" value="Consultar" /></td>
</tr>
</table>

<?php
$numfilas = mysql_num_rows($Recordset2);

echo '<table cellpadding="0" cellspacing="0" width="50%" >';
echo '<thead><tr><td>No.</td><td>SIGLA</td><td>NOMBRE</td><td>DESCRIPCION</td></tr></thead>';
echo "</table>";
?>
<div id="adentro2">
<?php
echo '<table cellpadding="0" cellspacing="0" width="50%">';
for ($i=0; $i<$numfilas; $i++)
{
$fila = mysql_fetch_array($Recordset1);
$numlista = $i + 1;

echo '<tr><td>'.$numlista.'</td>';
echo '<td>'.$fila['sigla_nucleo'].'</td>';
echo '<td>'.$fila['nombre_nucleo'].'</td>';
echo '<td>'.$fila['descripcion_nucleo'].'</td>';


echo '<td><a href="Editarnucleo.php?id='.$fila['sigla_nucleo'].'">Ver</a></td></tr>';
}
echo "</table>";
?>
</div>


</form>
</div>
<!-- InstanceEndEditable --></div>
</div>
</div>

</html>
<?php
mysql_free_result($Recordset1);

mysql_free_result($Recordset2);
?>