Solved

What is wrong with this php code ?

Posted on 2013-12-16
6
325 Views
Last Modified: 2013-12-16
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
Comment
Question by:team2005
  • 4
6 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
Do you have an error_log file?  You can look in the output of phpinfo() to find it.
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 150 total points
Comment Utility
I'm getting a parse error on line 17:

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

Try changing to this:

<?php   // -- Start bilder -->
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Accepted Solution

by:
ITTallahassee earned 350 total points
Comment Utility
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
 
LVL 2

Author Closing Comment

by:team2005
Comment Utility
thanks
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now