Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-13-2007, 03:35 PM
Junior Member
 
Join Date: Nov 2007
Posts: 1
Default Zend_Db Crashing Apache

I have a VERY simple statement, that I am sure is returning results, but it's crashing Apache... it works fine on my dev box (Windows Vista running Xampp), but it crashes my demo box (running CentOS 4, Apache 2)...

SELECT * FROM tablea WHERE field1=<num> AND field2=<num>

That's it...

$stmt = $db->query($query);
$rows = $stmt->fetchAll();

It crashes on the "$stmt = $db->query($query);" line, every time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-11-2007, 11:09 AM
Junior Member
 
Join Date: Dec 2007
Posts: 7
Default

Enable SQL query logging and check why then
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-18-2008, 04:13 PM
mgordon's Avatar
Junior Member
 
Join Date: Sep 2007
Location: Stockholm, Sweden
Posts: 16
Send a message via Skype™ to mgordon
Default

Use the quoteIdentifier() function and use the quoteInto() for the where see if you get a better query. See also if you get the same result with a select statement:

PHP Code:
$sel $my_db->select();
$sel->from('tablea')
$sel->where(array("field1=?" => $num1"field2=?" => num2);
$stmt $sel->query(); 
This should result in a safe query that shouldn't crash...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:26 AM.