Solved

Page displays blank

Posted on 2007-04-06
3
179 Views
Last Modified: 2007-04-06
What's up experts.  Got a question for you.  The code I have seems to be fine, yet I am getting a blank page.  Can anyone tell me why?

<?php
$conn = mysql_connect("127.0.0.1", "", "");
mysql_select_db("providers", $conn)
or die(mysql_error());

if ($_GET['list'] == "list") {

$SQLstr2 = mysql_query("SELECT tblAdspace.providerID, tblAdspace.strCompanyname FROM tblAdspace" or die(mysql_error());

while ($row = mysql_fetch_array($SQLstr2)) {
      $providerID = $row['providerID'];
      $strCompanyname = $row['strCompanyname'];
}
}
?>
0
Comment
Question by:pingeyeg
  • 2
3 Comments
 
LVL 28

Expert Comment

by:gamebits
ID: 18863546
put error_reporting(E_ALL); at the top of the page to see if there is any error.
0
 
LVL 24

Accepted Solution

by:
glcummins earned 500 total points
ID: 18863553
There is an error in your query:

 $SQLstr2 = mysql_query("SELECT tblAdspace.providerID, tblAdspace.strCompanyname FROM tblAdspace" or die(mysql_error());

Should be:

 $SQLstr2 = mysql_query("SELECT tblAdspace.providerID, tblAdspace.strCompanyname FROM tblAdspace") or die(mysql_error());

There was a missing parenthesis after the query string.

While troubleshooting scripts, error reporting should be enabled on the server, if at all possible.
0
 
LVL 28

Expert Comment

by:gamebits
ID: 18863556
My first thought would be that "list" is not being set so the query is not getting done, you could add an else statement to the script else{echo " the variable is not set";}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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