I'm trying to remote connect to MySQL database of a server and pull a row. But I'm having this issue :
I am able to pull some specific columns data but not able to pull the whole row.
Example :
This works :
-- Query 1
SELECT id, name, link, cat, image, title, features
FROM products
WHERE data_ready=1
ORDER BY id ASC
LIMIT 0,1
But this doesn't work :
-- Query 2
SELECT *
FROM products
WHERE data_ready=1
ORDER BY id ASC
LIMIT 0,1
Nor does this
-- Query 3
SELECT id, name, link, cat, image, title, features, description
FROM products
WHERE data_ready=1
ORDER BY id ASC
LIMIT 0,1
Please note that in query number three I'm trying to pull just one more column description
which was not in query 1. The LENGTH of the description field is 1314.
Something is limiting me to the amount of data that can be fetched but how do I find what and how to fix it?
By the way, SELECT @@max_allowed_packet
yields 1048576.
EDIT
By 'dont work' means the query is not returning anything but page keeps loading and eventually timeout.
Yes, I have tested the queries directly in Mysql and it works fine,
Actually I have like a central database server and many client servers who are all fetching the data from the central server. I am able fetch whole data to all the client servers except one ,where I am facing this issue. So I believe its something to do with some kind of php.ini
settings. I compared the phpinfo()
settings from all the servers but not able to figure out what might be causing this limitation.
Result of SHOW TABLE STATUS like 'products';
Space usage
Data 438.8 MiB
Index 7.5 MiB
Total 446.3 MiB
Row Statistics
Format Compact
Collation latin1_swedish_ci
Next autoindex 2,015,640
Creation May 19, 2014 at 01:46 PM
--- More INFO --- my Php code is simple :
<?php
$conn=@mysql_pconnect("xx.xx.xx.xx","DBNAME","DBPASS")or die("ERROR CONNECTING TO MYSQL SERVER");
@mysql_select_db("DBUSERNAME",$conn)or die("ERROR CONNECTING TO DATABASE");
$sql="select id,pid,name,link,cat,image,title,features,price,description from products order by id asc limit 0,1";
$execute=mysql_query($sql,$conn);
$row=mysql_fetch_assoc($execute);
print_r($row);
?>
Also Below two queries return data :
Query 4 - select id,pid,name,link,cat,image,title,features from products order by id asc limit 0,1
Query 5 - select id,pid,name,link,cat,image,title,description from products order by id asc limit 0,1
But If i try to fetch both Features and Description Together then the script never finished and eventually timeout. i.e.
Query 6 - select id,pid,name,link,cat,image,title,features ,description from products order by id asc limit 0,1
The same codes are working in other two servers i have. but i am not able to figure out what is wrong with this server configuration :/