What is wrong with this php code ?

Posted on 2013-12-16
Last Modified: 2013-12-16

Have this page -> php

  ini_set("display_errors", 1);

  $table6 = 'ImageTable';

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



 <?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));
  while($row3 = sqlsrv_fetch_array($rettmp)){

     $antbilder= $antbilder+1;         


   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>


    {?></tr><?php }?>  


Open in new window

This gives me a blank page ?

I cant figer out where the error is

Please help ASAP
Question by:team2005
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
LVL 110

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.
LVL 110

Assisted Solution

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

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

Try changing to this:

<?php   // -- Start bilder -->
LVL 110

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."
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

ITTallahassee earned 350 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 -->

Author Closing Comment

ID: 39721801
LVL 110

Expert Comment

by:Ray Paseur
ID: 39722826

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity, radiobuttonlist, c# 3 68
How do I allow for non standard CSV file 9 44
Want my table columns to autofit. 7 59
How would I break down this array? 3 15
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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).

739 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