LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2007, 08:29 AM   #1
gubak
Member
 
Registered: Jul 2004
Posts: 332

Rep: Reputation: 30
MySql problem


Hi!
I use CentOS 4.4, apache 2.0.52 webserver, php 4.3.9, mysql 5.0.

Everithing seems to work fine except mysql. My website (pure php) is already on the apache and work.
For example if I open a page with the content (php info page) :
Code:
<? phpinfo(); ?>
The server gives me the php info page.
But if I want to connect to mysql database, nothing happenes.
For example:
Code:
	


    mysql_connect("localhost", "username", "password") 
    or die("Error" . mysql_error()); 
    mysql_select_db("database") 
    or die("Error" . mysql_error());  
	
$result=mysql_query("SELECT * FROM table where Name='$name' order by datum DESC") or die("Error:" . mysql_error()); 

$rekord = mysql_fetch_object($result);
echo $record->Column_name;
If I try to connect to mysql database with wrong password, the result is the same, nothing happenes.

On the server side mysqld is runing, the database is opened and the mysql port is open.


Can somebody help me?
 
Old 04-13-2007, 08:37 AM   #2
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
Well I would guess that the RS is empty. Try performing the query on the database itself and make sure you are getting the results you are expecting to print. I say this becasue no errors are thrown at you on the connect. Good luck.
 
Old 04-13-2007, 09:00 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,267

Rep: Reputation: 298Reputation: 298Reputation: 298
Hi

Many setups have started to turn off displaying of PHP errors for security reasons. The default configuration should be as safe as possible, so I think it's a good idea. You can either look in the error log of Apache, turn it on in the php.ini file, or turn it on manually by calling ini_set in the PHP script.
 
Old 04-13-2007, 09:02 AM   #4
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by lord-fu
Well I would guess that the RS is empty. Try performing the query on the database itself and make sure you are getting the results you are expecting to print. I say this becasue no errors are thrown at you on the connect. Good luck.

What means RS?
 
Old 04-13-2007, 09:06 AM   #5
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,267

Rep: Reputation: 298Reputation: 298Reputation: 298
I think RS means result set. Your script will not output anything if there are no rows found. But using an incorrect password should give an error message.
 
Old 04-13-2007, 01:00 PM   #6
whk
Member
 
Registered: Jun 2005
Posts: 202

Rep: Reputation: 35
Guttorm is correct. Make a simple testing on MySql like make another db name and/or grant privilege with no password. Also, test it on the konsole too.
BTW, does the phpinfo have a MYSQL section?
and GL.
 
Old 04-16-2007, 01:47 AM   #7
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by whk
Guttorm is correct. Make a simple testing on MySql like make another db name and/or grant privilege with no password. Also, test it on the konsole too.
BTW, does the phpinfo have a MYSQL section?
and GL.
I don't know wether the phpinfo have a MYSQL section or not!
Here is the phpinfo page:
http://www.coka.co.yu/proba.php
 
Old 04-16-2007, 02:51 AM   #8
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,267

Rep: Reputation: 298Reputation: 298Reputation: 298
Hi

You are missing a Mysql module for PHP. Sorry I don't know CentOS, but I think it should have an RPM that you need to install. Try to search for "php mysql" or something.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Bugzilla - MySQL - perl - DBD::mysql install problem amchargue Linux - Software 3 09-10-2008 01:01 AM
Bugzilla - MySQL - perl - DBD::mysql install problem Runningonair Linux - Software 8 10-12-2007 01:42 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
php-mysql dependancy problem after nitemare mysql upgrade. RHEL4 andrewc Red Hat 1 01-03-2006 05:16 PM
MySQL server problem after linking (mysql.sock) ewijaya Linux - General 4 01-19-2004 10:46 AM


All times are GMT -5. The time now is 07:06 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration