Solved

Page displays blank

Posted on 2007-04-06
3
177 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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 look for a specific file type in a local or remote server directory using PHP.

746 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

9 Experts available now in Live!

Get 1:1 Help Now