Jump to content

where is the error


Go to solution Solved by lmcm2008,

Recommended Posts

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/280774-where-is-the-error/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.