LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-06-2005, 04:42 PM   #1
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Rep: Reputation: 31
Question php/,mysql problem: can't query


I am using debian sarge + apache2 + libapache2-mod-php4 on a laptop.

The problem is that php isnt doing queries to the db.

The whole story:
I am trying to learn php so i created a site that does some queries to mysql.

I created the user with the command:
GRANT ALL PRIVILEGES ON *.* TO 'mysite'@'localhost' IDENTIFIED BY 'mysite' WITH GRANT OPTION;

I can login as user "mysite" & query my database.[list=1][*] mysql logs doesnt show anything (no errors and no queries attemps from anywhere). So i think is a php (communication?) problem.[*] mysql_errno & mysql_error doesnt return any error to the page[*] php modules for apache are loaded and sites appear just fine.[*] Also i tried to use "mysql_fetch_array" instead of "mysql_fetch_row" but still not working
http://www.linuxquestions.org/questi...sql+cant+query[/list=1]

Is anyway to check the communication between apache2/php & mysql?

The strange is that following the same steps to my desktop pc everything works fine.


thx for your time

Last edited by JJX; 01-06-2005 at 04:51 PM.
 
Old 01-06-2005, 04:51 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Do you have the mysql libraries for php - create a php file with the following then access it and look for a mysql section:
<? phpinfo(); ?>
 
Old 01-06-2005, 04:53 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Have you looked at the httpd logs?
/var/log/httpd/error_log
 
Old 01-06-2005, 05:10 PM   #4
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Original Poster
Rep: Reputation: 31
I forgot install apache2 modules for mysql & php4-mysql package
thx a lot
 
Old 01-06-2005, 05:10 PM   #5
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by michaelk
Have you looked at the httpd logs?
/var/log/httpd/error_log
just for the history - nothing suspicious
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
php mcrypt cookie - mysql query lemack Linux - Security 3 02-09-2005 09:21 AM
php: Why Can't I Query Mysql DB?? flamesrock Programming 7 11-16-2004 12:36 AM
php mysql variable arguments in query. ldp Linux - Software 0 10-26-2004 07:56 AM
PHP MySQL Query Question vi0lat0r Programming 1 07-15-2004 05:02 AM
Mysql/PHP query problem with datetime field. Pcghost Programming 2 11-11-2003 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:10 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
Open Source Consulting | Domain Registration