LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-20-2003, 04:24 PM   #1
linxtc
LQ Newbie
 
Registered: Aug 2003
Distribution: Redhat 9
Posts: 7

Rep: Reputation: 0
PHP & MySQL, working, and yet getting a blank results page


MySQL works:

On my Linux PC, (Redhat 9) - I have MySQL working fine, and can connect to my databases and work with them fine using MySQL in the terminal and even the MySQL Control Center GUI(!)

PHP works:
I have verified that Apache and PHP are working also.
Connecting to localhost/hello.php
works nicely (renders "Hello World !" in my web-browser just fine).

My problem is: I have a simple search page setup, as I'm learning out of the O'Reilly "PHP and MySQL Web Development" book (see p. 225).

If I fail to enter a search term - I get the appropriate error message. But that's just HTML/Apache, not getting to the MySQL interaction.

If I enter a search term, for an item that IS in the MySQL database (confirmed via CLI and MySQL CC),

the "searchresults.php" returns a web-page with correct URL and Title on the web-page, but the rest of the page is blank.

I have the exact same setup working correctly on my OS X Mac - I can submit a query and get a web-page that returns/displays the result.

I initially did have some permissions errors with the files in Linux, but fixed the ownership and read/write/execute flags on the files in question.

I have placed the files on my Linux system, in:
/var/www/html

All thoughts/ideas/input welcome. TIA !
 
Old 08-23-2003, 04:00 PM   #2
nephilim
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (server), Kubuntu (desktop)
Posts: 248

Rep: Reputation: 30
Could you post the code of the page that you use to connect to the db?
 
Old 08-24-2003, 04:07 AM   #3
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
make sure u strip out any password information that u dont want anybody to know.
 
Old 08-24-2003, 09:42 AM   #4
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
i have found that when a php page comes up 100% blank thats because you have a syntax error in it. in command prompt do "php <php page with the probelms>" and it will tell you where the error is.
 
Old 08-24-2003, 12:46 PM   #5
linxtc
LQ Newbie
 
Registered: Aug 2003
Distribution: Redhat 9
Posts: 7

Original Poster
Rep: Reputation: 0
Ok - thank you all for your replies ! The answer is really very OT,
but you deserve to know what the resolution will be:

It seemed to me the big difference was, that my OS X box is running Apache 1.3.x, and the Linux box had Apache 2.x

Well, it comes down to that in a nutshell.

I am increasingly unimpressed with RH 9. First, I found it doesn't install MySQL by default (unless you do a custom install), but PostGreSQL. That's fine, but how many people - really, are going to use PostGreSQL over MySQL.

I installed MySQL from source and had it working fine.

Then, it turns out that the mod auth_mysql for Apache 2 was NOT installed. Huh ?

Well, no matter, in trying to fix this in an easy way things just got worse.

Because of dependancies and no easy way to work around them,
I'm just going to wipe and re-install.

There might be an easier way, but I'm already spending way too much time problem-solving and not working on PHP and MySQL !

/semi-rant.

Thank-you !

Last edited by linxtc; 08-24-2003 at 12:47 PM.
 
Old 08-24-2003, 04:51 PM   #6
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
install mandrake.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL results to html forms using PHP xemous Programming 3 08-15-2005 03:27 PM
[9.1 pro] Apache, MySQL & PHP ... not working! Dannyarr SUSE / openSUSE 5 10-17-2004 02:42 PM
PHP: changing row color showing mysql results emilioestevezz Programming 15 09-13-2004 06:27 PM
php not working Fedora 2 (blank screen) jomama Programming 2 08-27-2004 02:33 PM
SQL queries per page (PHP, MySQL) Silent1 Programming 2 06-27-2004 11:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration