group_concat function not returing all values in mysql–it returns some values with one comma at the end.
If you execute the below code and try to execute the query through phpmyadmin/php script. it will return only few records not all records. you can use the below files,db sructure to check the issues database table- create a table inside the db called ‘test’
1 2 3 4 5 |
CREATE TABLE IF NOT EXISTS `tbl_data` ( `id` int(10) NOT NULL, `question_id` int(10) NOT NULL, `user_id` int(10) NOT NULL ) |
# index.php
1 2 3 4 5 6 7 8 9 10 |
<?php include"connect.php"; for($i=0;$i<1500;$i++) { $query="insert into tbl_data(question_id,user_id) values('$i','10')"; $result=mysql_query($query,$linkfirst); } ?> |
#connect.php
1 2 3 4 5 6 7 8 |
<?php $linkfirst = mysql_connect('localhost', 'root', ''); if (!$linkfirst) { die('Could not connect: ' . mysql_error()); } mysql_select_db('test', $linkfirst) or die('Could not select database.'); ?> |
To get proper values… Read More »