LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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: 339

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: 64
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: 11,850

Rep: Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736
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: 339

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: 339

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


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 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


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration