variable sized arrays & global vars - another newbie question

This is a discussion on variable sized arrays & global vars - another newbie question within the PHP General forums, part of the PHP Programming Forums category; Hi all, yet again im struggling with php syntax after to many years with c. If anyone can help or ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-15-2003
Bob pilly
 
Posts: n/a
Default variable sized arrays & global vars - another newbie question

Hi all, yet again im struggling with php syntax after to many years with c.
If anyone can help or point me to some good doc's i'd would really appreciate it! My two questions are:

Can i declare an array that doesnt have a fixed size? Basically i want to assign the results of a query to the array but obviously the query results can change. Something along the lines of:
while($temp=mssql_fetch_array($tmresult)){
brandnew array = $temp["fieldname"];
}
this doesnt work for me, any ideas?
Also is it possible to have global variables within php? I have noticed that if i create a function i cant write to what i thought were global variables(declared outside the function). Im not trying to pass variables between pages, just use a global counter within a single page?

Thanks for any help in advance!


---------------------------------
Want to chat instantly with your online friends?*Get the FREE Yahoo!Messenger
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:22 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0