•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,753 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,702 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1132 | Replies: 2
![]() |
•
•
Join Date: Sep 2004
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
This one isnt working!
But this one Works
Well not woking in the sense the values of variables ($Date_Added[$num],$Sample_Views[$num]) not coming in the first. Whil in second its working!
Help me
function insertpath($num){
echo " <td colspan=\"3\" align=\"left\"> <br>\n";
echo " <b>Date Published</b>:",$Date_Added[$num] ,"<br>\n";
echo " <b>Sample</b>:",$Sample_Views[$num],"</td>\n";
}
insertpath(0);But this one Works
echo " <td colspan=\"3\" align=\"left\"> <br>\n"; echo " <b>Date Published</b>:",$Date_Added[$num] ,"<br>\n"; echo " <b>Sample</b>:",$Sample_Views[$num],"</td>\n";
Well not woking in the sense the values of variables ($Date_Added[$num],$Sample_Views[$num]) not coming in the first. Whil in second its working!
Help me
•
•
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation:
Rep Power: 4
Solved Threads: 4
There are two things you need to do to troubleshoot this problem. INSIDE your function, at the very top, do this:
First, echo out one of the arrays like this:
[PHP]
echo "<pre>";
print_r($Date_Added);
echo "</pre>";
[/PHP]
Then echo out the value of $num:
[PHP]
echo "<hr />".$num;
[/PHP]
You should see that $num = 0, but that your array does not even exist. You forgot one important line at the top of your function:
[PHP]
global $Date_Added, $Sample_Views;
[/PHP]
First, echo out one of the arrays like this:
[PHP]
echo "<pre>";
print_r($Date_Added);
echo "</pre>";
[/PHP]
Then echo out the value of $num:
[PHP]
echo "<hr />".$num;
[/PHP]
You should see that $num = 0, but that your array does not even exist. You forgot one important line at the top of your function:
[PHP]
global $Date_Added, $Sample_Views;
[/PHP]
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Function problem (C++)
- Insertion Sort Problem (C++)
- Ask Function problem?thanks (C)
- Abstract Class member function problem (C++)
- using OCI to call a ORACLE stored function (C++)
- static function problem (C++)
- AnsiString Template Data Return Problem Builder 6 (C++)
Other Threads in the PHP Forum
- Previous Thread: Money for Help
- Next Thread: Error with tables overlapping


Linear Mode