Solved

phpmyadmin select query returning a blank page.. why?

Posted on 2011-03-01
6
605 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 108

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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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 108

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to count occurrences of each item in an array.
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now