Hi: I have an error that will be very basic, but I don´t see it...
I have this first php:
<?php session_start(); require ("connecting.php"); require ("searchprofile.php"); connect(); $miuser=$_SESSION['usu']; $supas=$_SESSION['pas']; echo " Welcome: $miuser $supas<br />"; if ( busca_perfil_activo($miuser)==1) { echo "show $miuser<br />"; muestra_perfil($miuser); } else { echo "creating $miuser<br />"; crea_perfil($miuser); } mysql_close(); ?>
Ok.... maybe the problem is here:
if ( busca_perfil_activo($miuser)==1) { echo "show $miuser<br />"; muestra_perfil($miuser); } else { echo "creating $miuser<br />"; crea_perfil($miuser); }
and the function "busca_perfil_activo($miuser) is the following:
function busca_perfil_activo($activo) { $sql="SELECT * FROM perfil WHERE USUARIO='$activo' "; $result = mysql_query($sql); $totalreg=mysql_num_rows($result); if($result == 1) { return 1; } else { return 0; } }
Why this function always return 0 ?? I have a record that is ok with the search... and will return 1 in that case, but never do it...
Why?? Can you help me??
thanks.