Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/08/2008, 18:05
synapsevzla
 
Fecha de Ingreso: agosto-2008
Mensajes: 16
Antigüedad: 15 años, 8 meses
Puntos: 0
Respuesta: Necesito ayuida no se como hacerlo Consulta de datos con php y mysql

hola si eso lo e estado averiguando y ahora entiendo algo.

perio si te fijas mi copdigo comiensa asi claro yo nmo lo hago lo hace dreanweaver

Código PHP:
<?php require_once('../Connections/directorio.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$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;
}
}

mysql_select_db($database_directorio$directorio);
$query_Estados "SELECT * FROM estados ORDER BY Estado ASC";
$Estados mysql_query($query_Estados$directorio) or die(mysql_error());
$row_Estados mysql_fetch_assoc($Estados);
$totalRows_Estados mysql_num_rows($Estados);

mysql_select_db($database_directorio$directorio);
$query_todoclinetes "SELECT * FROM clientes COUNT(*) GROUP BY Estados";
$todoclinetes mysql_query($query_todoclinetes$directorio) or die(mysql_error());
$row_todoclinetes mysql_fetch_assoc($todoclinetes);
$totalRows_todoclinetes mysql_num_rows($todoclinetes);

$queryString_estados "";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_estados") == false && 
        
stristr($param"totalRows_estados") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_estados "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_estados sprintf("&totalRows_estados=%d%s"$totalRows_estados$queryString_estados);

$queryString_Recordset1 "";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_Recordset1") == false && 
        
stristr($param"totalRows_Recordset1") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_Recordset1 "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_Recordset1 sprintf("&totalRows_Recordset1=%d%s"$totalRows_Recordset1$queryString_Recordset1);

$currentPage $_SERVER["PHP_SELF"];

$queryString_Estados "";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_Estados") == false && 
        
stristr($param"totalRows_Estados") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_Estados "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_Estados sprintf("&totalRows_Estados=%d%s"$totalRows_Estados$queryString_Estados);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<?php do { ?>
    <a href="categoria.php?recordID=<?php echo $row_todoclientes1['id']; ?>"><?php echo $row_Estados['Estado']; ?></a>
    <?php } while ($row_Estados mysql_fetch_assoc($Estados)); ?>
</body>
</html>
<?php
mysql_free_result
($Estados);

mysql_free_result($todoclinetes);
?>
y no se en donde poner lo que me distes haunque creo que me falata algo mas de documentacion