hey all, I have a lil mysql/php/apache script that queries a database
and pulls put 5 integers.
These 5 integers are then displayed in an HTML table
Code: [Select]<?php
$i=0;
global $Val_Store;
while ($i < $num) {
$f1=mysql_result($result,$i,"Changes");
$f2=mysql_result($result,$i,"Disposition");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
</tr>
<?php
$Val_Store[i] = $f1;
$i++;
echo $Val_Store[i] . "-> Val_STORE" . $i . "<br />";
}
This is just a snippet.
But what is happening is:
A while loop is going through the rows of results obtained from the query, placing the values in temporary variables f1 and f2 (f1 are my integers of interest), and using f1 and f2 to fill the HTML table like this:
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
BUT what i am also doing is storing the temporary values in f1 in the array $Val_Store
Code: [Select]$Val_Store[i] = $f1;
$i++;
And then printing them ....
Code: [Select]echo $Val_Store[i] . "-> Val_STORE" . $i . "<br />";
Leaving me with
84-> Val_STORE1
114-> Val_STORE2
99-> Val_STORE3
77-> Val_STORE4
5-> Val_STORE5
WHICH IS SUPER!
BUT if i try executing the following code in other sections of my script....
Code: [Select]<?
echo "DEBUG " . $Val_Store[2] . " DEBUG";
?>
...the arrays appears to be empty. Surely it should have spat out element number 2!!
Output:
DEBUG DEBUG
^
Can anyone help me keep my array elements??
Many Thanks
Grouping and sorting results
Please help with this query.I have 2 tables in a database, countires and cities. states looks like thiscountriesid -----------country1 ------------uk2 ------------us3 ------------japancitiesid
how to easy edit text, with box? Help.
Hi.I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy for her as possible to edit the text. So, I am going to make a Admin site where she can login and then I
Rounding a number queried from a database
I know that to display a rounded number you just do echo "round($number)";. But how would I convert the $number varible into a rounded number, so that when I say echo "$number";
Best way to check for end of a record and send it back to the first record
I'm hoping someone can help me out and explain the best way to accomplish this.What I'm doing I'm pulling data from a data base. I display the information 1 item at a time then have a next and
CHMOD script
Hi,I need a script to read all files in a folder and set to 777.Can anyone help out please?
reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos selected from the most recently submitted ones, and displayed at the top of the page. I figured
PHP header help!
Hi all I am trying to get this php page to refresh every 5 seconds on my phone which is an aastra 480i IP desk phone.The code below the header line displays a menu on my phone. That works fine so no
PHP Directory Listing Not working
Hey Guys,I need help, I tried a ton of directory listing scripts and they all don't work. Althogh the normal Apache Directory Indexing does work when you visit. The URL is
PHP Include not working
The website is http://www.grlistingservices.comThe code block is as follows:<?phpif (!isset($id)){include 'home.php';}else{include "$id.php";}?>All files are in the same
Taylor Series Function
So I am working a a project for my intro C++ class, and I am having some trouble with a function for approximating exp(x) using a taylor series. The taylor series approximations for exp(x) is: