Solved

phpmyadmin select query returning a blank page.. why?

Posted on 2011-03-01
6
609 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 109

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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

786 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