note 41174 added to function.mysql-unbuffered-query

From: Date: Thu, 01 Apr 2004 19:19:28 +0000
Subject: note 41174 added to function.mysql-unbuffered-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-67482@lists.php.net to get a copy of this message
If you are going to do a large query, but are concerned about blocking access to the table during an unbuffered query, why not go through a temporary table? (Of course, this is predicated on the current user having permission to create tables.) $dbQuery = "SELECT something ..."; if (mysql_query ("CREATE TEMPORARY TABLE MyQuery $dbQuery")) { $numRows = mysql_affected_rows(); if ($numRows == 0) { /* handle empty selection */ } else { $result = mysql_unbuffered_query ('SELECT * FROM MyQuery'); /* handle result */ } mysql_query ('DROP TABLE MyQuery'); } ---- Manual Page -- http://www.php.net/manual/en/function.mysql-unbuffered-query.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41174 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41174&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41174&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67482) next »