General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 14th, 2003, 02:52 PM
Unquick Unquick is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Sarnia, Ontario
Posts: 4 Unquick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Functions and arrays - ARRG!!

Ok here is the problem. I am doing a var_dump at the end to make sure I have the correct values in the array; which I do... I get this: array(2) { [0]=> string(3) "232" [1]=> string(3) "132" }

So I should be able to do a return statment and this values should be brough back, right? Wrong. I do another var_dump in the script that requested the function after the function is excuted and I get the same values. Now how do I get the data out of that array?

This is the main file
PHP Code:
<?php
//If there is no menuID then exit; you can't do anything without it
if($menuID == '' || $menuID == NULL){
    echo 
"Error 001, please contact support";
    exit;
}
$header_message "Welcome, you are logged in as Administrator";

// Includes 
include_once("config.php"); 
include_once(
"css.php"); 


FMENU_DRAW($menuID$header_message);

switch(
$menuID){
    case 
0:
       include(
"default.php");
       break;
    
    default:
       echo 
"There was a problem";
}


?>



This is the function:
PHP Code:
function QUICK_STATS_QUERY(){
    global 
$link;
    
$query1 "SELECT count(user_expirydate) FROM users WHERE user_expirydate >= curdate()";
    
$query2 "SELECT count(user_expirydate) FROM users WHERE user_expirydate < curdate()";
    
    for(
$i=0$i <= 1$i++){
    
$query_array = array($query1$query2);
    
$QUERY_quickstats $query_array[$i];
    
$infoquery_results mysql_query($QUERY_quickstats$link) or die("MySQL query infoquery failed.  Error if any: ".mysql_error());
    
$infoquery_results mysql_fetch_array($infoquery_results);

    
$active_details[$i] = $infoquery_results["count(user_expirydate)"];
    } 
   
var_dump($active_details);
   return array (
0);


Reply With Quote
  #2  
Old June 15th, 2003, 01:20 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
Quote:
var_dump($active_details);
return array (0);


Either I am reading this wrong or you are returning an empty array.

You just var_dump'ed an array called $active_details
Then you do a: return array(0);

What do you expect to have returned?
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #3  
Old June 18th, 2003, 11:23 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
If this helped please post back and let everyone know... if it didn't work maybe we can help.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Functions and arrays - ARRG!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT