Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

What is wrong with this php code ?

Hi!

Have this page -> php

<?php
  error_reporting(E_ALL);
  ini_set("display_errors", 1);

  require_once('RAY_EE_config.php');
  require_once('Connect_databse.php');
  $table6 = 'ImageTable';

  $sql = "SELECT * FROM {$table6}";
  $resultraptmp = sqlsrv_query($conn,$sql);

?>

<table>
  

 <?php   <!-- Start bilder -->

  $sql = "SELECT * FROM {$table6} WHERE LocationID={$lokasjonnr} and TransactionID={$TransactionID}";
  $rettmp = sqlsrv_query($conn,$sql);

  if( $rettmp === false )
  {
       echo "Error in executing statement 7.\n";
       die( print_r( sqlsrv_errors(), true));
  }
  
  $antbilder=0;
  while($row3 = sqlsrv_fetch_array($rettmp)){

     $antbilder= $antbilder+1;         
  }
  
  ?> 

  <?php
  if($antbilder>0)
  {

  ?>
    <tr>
  <?php 
   while($row3 = sqlsrv_fetch_array($resultraptmp)){
       
       $bilde1 = "data:image/jpg;base64,"; 
       $bilde2 = $row3['TransImage'];
       $bilde = $bilde1 . $bilde2; 
       
    ?>
        <td valign="top" class="rapport_image1"><img src='<?php echo $bilde ?>' hight="220" align="left"></td>

  <?php}?>

  <?php
    if($antbilder>0)
    {?></tr><?php }?>  


   
</table>    

Open in new window


This gives me a blank page ?

I cant figer out where the error is

Please help ASAP
0
team2005
Asked:
team2005
  • 4
2 Solutions
 
Ray PaseurCommented:
Do you have an error_log file?  You can look in the output of phpinfo() to find it.
0
 
Ray PaseurCommented:
I'm getting a parse error on line 17:

<?php   <!-- Start bilder -->

Try changing to this:

<?php   // -- Start bilder -->
0
 
Ray PaseurCommented:
You're likely to see another parse error at line 52.  But I can't guess at the logic you're trying to achieve, so I don't have any suggestion for that.

Who is your hosting company?  They might be able to turn on your error reporting in a way that would let you see the errors on the screen and not have to go looking in a file every time you get the "white screen of death."
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ITTallahasseeCommented:
You forgot to close the IF statement started on line 38.   Adding a second "}" to 58 would do it.
{?></tr><?php }
}  ?> 

Open in new window


As well as what was mentioned above:
<?php   // -- Start bilder -->
0
 
team2005Author Commented:
thanks
0
 
Ray PaseurCommented:
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now