Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-22-2011, 04:53 AM   #1
LQ Newbie
Registered: Mar 2011
Posts: 26

Rep: Reputation: 0
PHP Warning: mysql_fetch_row() errror in global address book script.

Hi. I have installed qmail server on redhat. while configuration on global address book with below link:

I am getting below error while running script.
#Squirrelmail global address book updater...
PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /etc/qmailfile/sqweb_gabook.php on line 45
Global Address for is available at /etc/qmailfile/hometest.com_gabook
Enter the fullpath using Squirrelmail config utility
select 6. Address Books option and configure address book in 3. Global file address book
More info:

I have pasted sqweb_gabook.php script below:

// your domain table name inside vpopmail database

// process
$handle = fopen($global_abook, 'a');
$conn = mysql_connect($hostname, $username, $password) or die ('Error
connecting to mysql');

$query = "select pw_name,pw_gecos from $tablename";
$result = mysql_query($query);

while(list($email,$name) = mysql_fetch_row($result))

fwrite($handle, $data);


All username and password of mysql are working fine.

Please let me know that changes need to be done.

Old 09-22-2011, 07:36 AM   #2
Registered: Aug 2011
Location: Croatia
Distribution: Debian 7/Ubuntu 14.04
Posts: 57

Rep: Reputation: 9
I think this question shall be on some PHP forum, or programming forum here.

Anyway, such an error is typical either for a unsuccessful connection with a database or a wrong query.
At first glance, this line is wrong:

it shall be:
mysql_select_db($conn, $database);
Also, if you wrap code, everything would be more readable. (on toolbar you have sign # or another one for PHP code).


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
Regarding squirrel mail global address book ghpradeep Linux - Server 7 04-06-2011 05:15 AM
exchange global address book in kmail newyearsk Linux - Software 0 08-22-2004 03:33 AM
share global address book ythevenot Linux - Software 0 04-21-2004 06:21 AM
Warning: mysql_fetch_row(): ?? huno Linux - General 2 10-25-2002 02:10 PM
mail server w/ global address book stroh78 Linux - General 1 07-07-2001 04:01 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:16 AM.

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