Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

phpmyadmin select query returning a blank page.. why?

Posted on 2011-03-01
6
Medium Priority
?
635 Views
Last Modified: 2012-05-11
I have this table in my database that has two columns with over 10,000 rows:

1) ID - int
2) Sessions - mediumtext

When I do a search query like the attached code below, the phpmyadmin page is returning a blank white page. Why is that? How could i fix this? If I do search in the ID column it is returning just fine.

I'm testing on a local machine with XAMPP installed btw.


SELECT * FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'

Open in new window

0
Comment
Question by:Bandai2
6 Comments
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35006204
The machine may be running out of execution time or memory. Check the apache error logs
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 35006215
Try adding LIMIT 5 to the query string and see if you get 5 results.  Then make it LIMIT 100, then LIMIT 1000, etc.  Your query has to read all of the text in the "Sessions" column and do some rather intense processing.  If the LIMIT statements work, then I'm expecting that your script may be timing out.  If the LIMIT statements return nothing, then you might want to check character encoding or something like that - a test case that you know for sure works would be helpful.
0
 

Author Comment

by:Bandai2
ID: 35006353
bportlock,

I've already increased the execution time and memory allocated to PHP.


Ray Paseur,

I've tried the limit to 5 results and it showed the results, but if I changed it to 10 or more it is displaying the white blank page again. How could I fix this timeout issue?

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Expert Comment

by:pius_babbun
ID: 35006496
Try to execute the Query with php code mysql_query($query) where $query contains your actual query and you can use mysql_error() to get the data base error.Hope it helps
$conn   	= mysql_connect('hostname','db user name', 'db password');
$database	= mysql_select_db('database_name');
$Query  	= "SELECT * FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'";
$Result 	= mysql_query($query) or die('Mysql Error :' .mysql_error());    //SHOW QUERY ERROR

Open in new window

0
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 2000 total points
ID: 35006642
If each record does not already have a unique ID code then add one and alter your query from

"SELECT * FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'";

to something more like

"SELECT id FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'";

so that you do not use up large amounts of memory in result sets. You can always retrieve each record on an individual basis using its ID
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 35007356
I second this idea - ID:35006642 - and I would like to suggest that you try it again with the gradually increasing LIMIT clauses.  You may find that this solution works, or you may find that the requirement to do the fulltext table scan is just too much work to complete in a reasonable amount of time.

Do you have fulltext index on the sessions column?  Have you tried EXPLAIN SELECT to see if it has any suggestions for you?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question