php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31385 Extract - problem
Submitted: 2005-01-03 08:55 UTC Modified: 2005-01-04 06:18 UTC
From: boriskolev at abv dot bg Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.3.8 OS: RedHat 9.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: boriskolev at abv dot bg
New email:
PHP Version: OS:

 

 [2005-01-03 08:55 UTC] boriskolev at abv dot bg
Description:
------------
When you have array with text index-es(hash) and when you extract this array to variables if some of array columns have null value variable for this column do not clears.
For example in code reproduce :
if for example column "keyword" is null for some row variable $keyword after extracting do not clears.

Reproduce code:
---------------
$query = "SELECT
						a.agent_sid,
            a.country_sid,
            a.region_sid,
						a.keyword,
						a.agent_frequency_sid,
						a.last_email,
						u.email,
						CONCAT(u.first_name, ' ', u.last_name) as fullname
					FROM
						AGENT a INNER JOIN USER u
					ON
						a.user_sid=u.user_sid INNER JOIN OBJECT_HISTORY o
					ON
						u.object_history_sid=o.object_history_sid
					WHERE
						o.object_status_sid=1
					AND
						(a.agent_frequency_sid=2 OR agent_frequency_sid=DAYOFWEEK(DATE_ADD(CURDATE(), INTERVAL -1 DAY))+2)
					";

$agent_result = query($query);while ($row = mysql_fetch_array($agent_result,MYSQL_ASSOC)) {
	extract($row);
};


Expected result:
----------------
to fech result into array and then to extract array into variables for each row and if cell empty or null variable be empty too.

Actual result:
--------------
variable do not clears

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-04 06:18 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

Also the PHP version in use is too old. We're currently at 4.3.10, so if you can reproduce this problem with it, reopen.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 17:01:33 2024 UTC