Like the title says, does MODx support a function to clear the chunk of all data prior to repopulating it?
The important thing is not to stop questioning. Curiosity has its own reason for existing. One cannot help but be in awe when he contemplates the mysteries of eternity, of life, of the marvelous structure of reality. It is enough if one tries merely to comprehend a little of this mystery every day. Never lose a holy curiosity.
-Albert Einstein (1879 - 1955)
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
-
☆ A M B ☆
- 24,524 Posts
Context would be useful; having no idea what you are trying to do makes it difficult to offer any suggestions.
Sorry Susan,
<?php
//list out all the dogs in the system
$output='';
switch($_REQUEST[breed]){
case goldens:
$goldens= sprintf("
SELECT *
FROM tbldogs
WHERE breedID=87
ORDER BY callname;");
$rsetg=$modx->db->query($goldens);
if ($modx->db->getRecordCount($rsetg) > 0) {
while ($row = $modx->db->getRow($rsetg)) {
$params['id']=$row['dog_id'];
$params['callname']=$row['callname'];
$params['regname']=$row['regname'];
$output.=$modx->parseChunk('List Dogs', $params, '[+', '+]');
}
}
return($output);
break;
case cavaliers:
$cavaliers=sprintf("
SELECT *
FROM tbldogs
WHERE breedID=51
ORDER BY callname;");
$rsetc=$modx->db->query($cavaliers);
if($modx->db->getRecordCount($rsetc) >0){
while($foo = $modx->db->getRow($rsetc)){
$params['id']=$row['dog_id'];
$params['callname']=$row['callname'];
$params['regname']=$row['regname'];
$output.=$modx->parseChunk('List Dogs', $params, '{+','+]');
}
}
return($output);
break;
}
function update( &$fields ){
}
function add(&$fields){
}
function delete(&$fields){
echo $fields;
return($message );
}
// check for a valid submission
if($_REQUEST['Submit']){
$message = delete($_REQUEST);
echo $message."<br />";
}
?>
However, in my chunk for the breed cavaliers, I get 15 rows with a value of null.... So I was wondering if I needed to clear the chunk out before populating it again....
The important thing is not to stop questioning. Curiosity has its own reason for existing. One cannot help but be in awe when he contemplates the mysteries of eternity, of life, of the marvelous structure of reality. It is enough if one tries merely to comprehend a little of this mystery every day. Never lose a holy curiosity.
-Albert Einstein (1879 - 1955)
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
It looks like your not changing $rsetc and $rsetg in your loops so you’re getting the same row each time.
It looks like your not changing $rsetc and $rsetg in your loops so you’re getting the same row each time.
Where are you seeing this? I know I am a noob when it comes to programming, but I think I’ve done that....
The important thing is not to stop questioning. Curiosity has its own reason for existing. One cannot help but be in awe when he contemplates the mysteries of eternity, of life, of the marvelous structure of reality. It is enough if one tries merely to comprehend a little of this mystery every day. Never lose a holy curiosity.
-Albert Einstein (1879 - 1955)
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Never mind my comment. I was forgetting that getRow() increments the row pointer.
I think Garry is right.
Thank you gary,
I forgot I created $foo.... My bad.
The important thing is not to stop questioning. Curiosity has its own reason for existing. One cannot help but be in awe when he contemplates the mysteries of eternity, of life, of the marvelous structure of reality. It is enough if one tries merely to comprehend a little of this mystery every day. Never lose a holy curiosity.
-Albert Einstein (1879 - 1955)
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635