Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/08/2009, 12:57
LeonardoEF
 
Fecha de Ingreso: enero-2008
Ubicación: Chaco
Mensajes: 116
Antigüedad: 16 años, 3 meses
Puntos: 0
Problema con Select SQL

Hola,

este es el asunto:

tengo dos tablas users y statuses; hago un inner join entre las dos tablas,
las dos tienen un campo id.

Código:
"SELECT * from statuses inner join users on statuses.user = users.username where permissions = 'public' and status like '%@$user%' order by statuses.id desc limit $q"
bueno, todo bien, pero cuando quiero conseguir el valor del id del status y no del usuario tengo problemas :(

hago esto:

Código PHP:
$status_query "SELECT * from statuses inner join users on statuses.user = users.username where permissions = 'public' and status like '%@$user%' order by statuses.id desc limit $q"

$statuses_q mysql_query($status_query$conexion) or die (mysql_error());
    
    while(
$reg_statuses mysql_fetch_array($statuses_q)){
        if(
$reg_statuses['imgfile'] != ""){
            
$imgfile $reg_statuses['imgfile'];
        }else{
            
$imgfile 'no-photo.png';
        }
        
        
$statuses[] = array(
                            
'id' => $reg_statuses['id'],      //Este quiero que sea el id del status no del usuario...
                            
'status' => $reg_statuses['status'],
                            
'user' => $reg_statuses['user'],
                            
'imgfile' => $imgfile,
                            
'name' => $reg_statuses['name'],
                            
'time' => $reg_statuses['time'],
                            
'from' => $reg_statuses['from'],
                            
'reply' => $reg_statuses['reply'],
                            
'permissions' => $reg_statuses['permissions']
                            ); 
    } 
Intenté poniendo $reg_statuses['statuses.id'];
pero no pasa naa xD jejje
php no es mi fuerte y sinceramente no se como se hace xD

Gracias
Salu2
__________________
La web es ciencia xD www.resiscity.com.ar, http://www.leoferreyra.com.ar