* QuickEdit post * Edit post * Delete post * Report this post * R

Discussion in 'PHP' started by macaela, Jul 17, 2011.

  1. #1
    Hi i have the following code that i am trying to work, on the site was done before by another developer but now i am working on it now one of the problems i have encounter when i downloaded the file and installed on my local machine is keeps giving me the error
    Notice: Use of undefined constant client_company_name - assumed 'client_company_name' in C:\xampp\htdocs\folder\public_html\index.php on line
    repeated in all the rows on the database but i've noticed that here it says $rowci as before i've only seen $row without the ci does the ci as special way of working from the $row.
    i've also noticed i have ci on ($queryci), (resultci), (connectionci)

    the same on all of this variables so all of them i get the undefined variable error
    $client_addr_01	= $rowci[client_address01];
    $client_addr_02 = $rowci[client_address02];			
    $client_addr_city = $rowci[client_city];
    $client_addr_county	= $rowci[client_county];			
    $client_addr_postcode = $rowci[client_postcode];
    $client_addr_telephone 	= $rowci[client_telephone];		
    $client_addr_email = $rowci[client_email];
    $client_url = $rowci[client_url];
    PHP:
    this the whole code
    <?php	$client="BELLWAY";	
    
    $office="All";?>
    <?php	$playme = "true";?>
    <?php	//
    
    $playme=1;
      if($efilm=="")
          {
    		$efilm="http://www.player.com/player/home/".$client."/".$client.".flv";// name of first film to play
    	   }
             else
    	   {		// nothing	
    
    }
    ?>
    
    <?php	//Grab the Clients Full name and weblink details here	//get the DB connection variables	
    
    include("../../includes/config.php");	    	//connect to DB	
    
    $connectionci = @mysql_connect($db_address,$db_username,$db_password) or die("Couldn't CONNECT.");
    $dbci = @mysql_select_db($db_name, $connectionci) or die("Couldn't select DATABASE.");		//SELECT All based on current cookie  formation	
    
    $queryci="SELECT * FROM clients WHERE (client_company = '$client')";	
    $resultci = mysql_query($queryci) or die("Couldn't execute QUERY.");
    while ($rowci = mysql_fetch_array($resultci)) {$client_name	= $rowci[client_company_name];      
    
    $client_addr_01	= $rowci[client_address01];
    $client_addr_02 = $rowci[client_address02];			
    $client_addr_city = $rowci[client_city];
    $client_addr_county	= $rowci[client_county];			
    $client_addr_postcode = $rowci[client_postcode];
    $client_addr_telephone 	= $rowci[client_telephone];		
    $client_addr_email = $rowci[client_email];
    $client_url = $rowci[client_url];
     }
    mysql_close($connectionci);
    ?>
    
    <script src="../jrp/tvdata.js" type="text/javascript"></script>
    <script type="text/javascript" src="../swfobject/swfobject.js"></script>
    <script type="text/javascript" defer="defer">setTimeout('createPlayer()', 1000) </script>
    
    <script type="text/javascript">
    
    var flashvars = {
    'file':   '<?php echo $efilm; ?>',
    'autostart':       'true',
    'stretching':      'exactfit',
    'volume':          '100',
    'image':           '../player/preview.jpg'
    };
     
    </script>
    
    PHP:
     
    macaela, Jul 17, 2011 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    first add ' to $rowci ($rowci['client_email']])
    second, i have no idea what your problem is ;)
     
    EricBruggema, Jul 23, 2011 IP
  3. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #3
    Websites php.ini is more lazy at Error notices. Proper php coding you would wrap all your $vars['in_quotes'] and not $var[out_of_quotes]; Php is just telling you that you would use single quote or double quotes with your $var["vars"];

    Due to a change of requirements between php versions, it became necessary to define and/or initialize all the constants and variables used in php The work-round to this issue is to change the php.ini settings from

    error_reporting = E_ALL
    to
    error_reporting = E_ALL & ~E_NOTICE

    Change and it will not show you the Error Notices like that. In addition you would need to make each of your $var equal to something before using them. It is telling you need to do that, but you don't have to do that really. Just telling you to do proper php coding and not short cuts php coding. :p
     
    exodus, Jul 24, 2011 IP
  4. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #4
    exodus: isn't it fair to tell him how to fix the problem without hidding the problem?
     
    EricBruggema, Jul 25, 2011 IP