buenas amigos como ya eh comentado en otros temas tengo un serio problema con una aplicacionsita, es algo sencilla, pero yo aun soy novato, tengo el siguiete codigo
Código PHP:
<?php require_once('Connections/datosusuarios.php'); ?>
<?php
mysql_free_result($cedula_codigo);
?>
<?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;
}
}
mysql_select_db($database_datosusuarios, $datosusuarios );
$query_cedula_codigo = "SELECT codigo, cedula FROM datos_usuario";
$cedula_codigo = mysql_query($query_cedula_codigo, $datosusuarios) or die(mysql_error());
$row_cedula_codigo = mysql_fetch_assoc($cedula_codigo);
$totalRows_cedula_codigo = mysql_num_rows($cedula_codigo);
while($array = mysql_fetch_array($cedula_codigo)) {
$to[$i++] = $array['codigo'];
}
foreach ($to as $array) {
$resultado= array ('"'. $array .'",');
echo $resultado;
}
//echo '," '.$array['codigo']. '';//.'","'.$array['cedula'].'",';
//$array = mysql_fetch_array($cedula_codigo)
for ( $j=0; $i<count($resultado); $j+1){
$nombre= $resultado[$j];
break;}
print "nombre=". $nombre;
?>
lo que quiero hacer convertir los datos recuperados de la base de datos en un array para posteriormente solo llamar un solo dato del indice el array mi problema ahora mismo es convertir dichos datos a un array y luego llamar un solo de esos datos por el numero de su indice
eso es loq ue eh hecho hasta ahora agradeseria la ayuda gracias mi amigos