Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

What is wrong with this php code ?

Posted on 2013-12-16
6
Medium Priority
?
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 111

Expert Comment

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

Assisted Solution

by:Ray Paseur
Ray Paseur earned 600 total points
ID: 39721567
I'm getting a parse error on line 17:

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

Try changing to this:

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

Expert Comment

by:Ray Paseur
ID: 39721581
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's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 2

Accepted Solution

by:
ITTallahassee earned 1400 total points
ID: 39721689
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
ID: 39721801
thanks
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39722826
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

722 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