Blank Page

This is a discussion on "Blank Page" within the PHP Forum section. This forum, and the thread "Blank Page are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 10th, 2007, 14:55
Junior Member
Join Date: Jul 2007
Location: England
Age: 21
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Question Blank Page

Hi, I am trying to connect a php website to a database and display the contents.

But I am getting a blank page (no error messages) instead.

I have one file called odbc.php, that I'm pretty sure makes a connection to the database, with this code:
PHP: Select all

<html>
<body>
<?php
$odbc 
odbc_connect ('testDB''root''') or die ('Could not connect');
if (
$odbc != 0) echo ('Connection made!');
 
if(!
function_exists('odbc_fetch_array')) 
 

  function 
odbc_fetch_array($result$rownumber=-1
  {        
      if (
PHP_VERSION '4.1'
      { 
 if (
$rownumber 0
          { 
              
odbc_fetch_into($result$rs); 
          } 
          else 
          { 
              
odbc_fetch_into($result$rs$rownumber); 
 
          } 
 
      } 
      else 
      { 
 
odbc_fetch_into($result$rownumber$rs); 
      } 
 
      
$rs_assoc = Array(); 
      foreach (
$rs as $key => $value
      { 
          
$rs_assoc[odbc_field_name($result$key+1)] = $value
      } 
       return 
$rs_assoc
  } 

 
?> 
</body>
</html>
And another file, query.php that is supposed to print the data from the database:
PHP: Select all

<html>
<body>
<?php 
require_once('odbc.php'); 
$query odbc_exec($odbc"SELECT * FROM Customers") or die (odbc_errormsg()); 
while(
$row odbc_fetch_array($query)) 

    echo 
'Customer First Name: '.$row['customer_first_name'].'<br />'
    echo 
'Customer Last Name: '.$row['customer_last_name'].'<br />'
    echo 
'Customer Email: '.$row['email_address'].'<br />'
    echo 
'<hr />'

odbc_close($odbc); 
?> 
</body>
</html>
Unfortunately it just gives me a blank page! Help!
Reply With Quote

  #2 (permalink)  
Old Jul 10th, 2007, 15:28
Junior Member
Join Date: Jul 2007
Location: England
Age: 21
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Red face Re: Blank Page

Nevermind, its working now! There was no information in my database!! How embarassing.
Reply With Quote
Reply

Tags
access, blank, database, microsoft, no error, odbc, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blank Space between 2 rows JunkFood Web Page Design 1 Mar 26th, 2008 22:33
[SOLVED] Mind went blank.. Trying to get a page to read..... mcdanielnc89 Web Page Design 13 Sep 27th, 2007 00:42
Blank line problem dartiss Web Page Design 8 Aug 6th, 2007 21:28
Swf is blank? spires Flash & Multimedia Forum 3 Jul 21st, 2007 22:36
CSS Completely Validated, BLANK page in IE Sulman Web Page Design 7 May 16th, 2007 06:30


All times are GMT. The time now is 22:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43