Jump to content


Photo

help me please!!!!


  • Please log in to reply
2 replies to this topic

#1 mauri_gato

mauri_gato
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 31 May 2006 - 10:22 AM

I am developing a site that uses multiple queries. It works fine on my remote server of my company. But when i use my own prove server with Apache or even IIS and PHP 4 and even 5 i get the same error when executing a query:

Notice: Undefined variable: Clinica in e:\Inetpub\wwwroot\Prueba\Bienvenida5.php on line 79

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in e:\Inetpub\wwwroot\Prueba\Bienvenida5.php on line 79


I don't know what might be happening, i have the exact copy of the site in my system.

Here is the section code that doesn't run:

          <TR>
            <TD height="
            <?php 
                mysql_select_db($database_clinica, $clinica);
                $query_rsMenu = "SELECT COUNT(m.menCod) * 21 AS Total FROM Menu m, Privilegio p, Grupo g, Miembro i, Usuario u WHERE m.menSuperior IS NULL AND m.menCod = p.menCod AND p.gruCod = g.gruCod AND i.gruCod = g.gruCod AND i.usuCod = u.usuCod AND u.usuNombre = '".$_SESSION['usuNombre']."'";
                $rsMenu = mysql_query($query_rsMenu, $Clinica) or die(mysql_error());
                $row_rsMenu = mysql_fetch_assoc($rsMenu);
                echo $row_rsMenu['Total'];
            ?>">&nbsp;<?php echo($query_rsMenu); ?></TD>
          </TR>


The code should generate the height of a column in base of $_SESSION['usuNombre'].

Help me please, thank you guys.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 May 2006 - 02:19 PM

You have two variables which are the same but are typed differently. The variables I am talking about are $clinica and $Clinica

Notice one has a lowercase c and the other has an uppercase c

PHP sees those variables as two completly different variables. PHP is case-sensitive with variablesname so if you change $Clinica to $clinica PHP should now be able to use your mysql link resource which is stored in the $clinica variable.

#3 mauri_gato

mauri_gato
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 31 May 2006 - 07:17 PM

Thank you wildteen88, it was my mistake. I had 2 conexion files in my server (that dreamweaver made) and just one in my computer. That's why one was uppercase and the other was not.

Really appreciated your help, thanks a lot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users