Solved

Page displays blank

Posted on 2007-04-06
3
188 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
[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
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

630 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