Jump to content

gladiator83x

Members
  • Posts

    45
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gladiator83x's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi All, I have been having a ton of trouble trying to graph w/o the gd library. I was looking for a class that will let me graph one array against another array. Or pretty much--one sql column vs another. Anyone know of any links or information on how to do this. I have been downloading different scripts with their classes, and I got nothing  :-[
  2. How will I do that? I know that when I try to echo out $line, it just outputs 'Array' numerous times
  3. Hi All, I created a new table called Defects, which has 4 columns. I am trying to save the entire column as an array...is that possible. This is what I have tried. ------------------------------------------------------ $array= "SELECT Review_Defects.Defects FROM Review_Defects"; $array_result= mysql_query($array) or die('Query failed: ' .mysql_error()); while ($line = mysql_fetch_array($array_result, MYSQL_ASSOC)) { foreach ($line as $col_value){ // echo $col_value; } echo  $col_value; //--echoes everything in column } //echo  $col_value; --just echoes the last thing in column --------------------------------------------------------- If I echo within the loop, I receive everything inside the column--which is what I want within my array. Is there some sort of function that I will have to use?
  4. baachart.php is the class-- the actual file has the following code: include('baaChart.php'); $mygraph = new baaChart(600); $mygraph->setTitle('Regional Sales','Jan - Jun 2002'); $mygraph->setXLabels("Jan,Feb,Mar,Apr,May,Jun"); $mygraph->addDataSeries('L',LINE_MARK_X,"25,30,35,40,30,35","South"); $mygraph->addDataSeries('L',LINE_MARK_CIRCLE,"65,70,80,90,75,48","North"); $mygraph->addDataSeries('L',LINE_MARK_SQUARE,"12,18,25,20,22,30","West"); $mygraph->addDataSeries('L',LINE_MARK_DIAMOND,"50,60,75,80,60,75","East"); $mygraph->addDataSeries('L',LINE_MARK_NONE,"30,45,50,55,52,60","Europe"); $mygraph->setBgColor(255,255,255,1); //Transparent $mygraph->setXAxis("Month",1); $mygraph->setYAxis("Sales (£000)",0,100,10,0); $mygraph->drawGraph();
  5. I downloaded this graphing class and tried the sample code located here: http://members.aol.com/barryaandrew/baaChart/baachartguide.html#samples However, my graphs dont show up-- I get the following errors: ------------------------------------------------------------------- Warning: main(baaChart.php) [function.main]: failed to open stream: No such file or directory in /export/home2/webpages/baa.php on line 2 Warning: main() [function.include]: Failed opening 'baaChart.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /export/home2/webpages/baa.php on line 2 Fatal error: Class 'baaChart' not found in /export/home2/webpages/baa.php on line 3 ----------------------------------------------------------------- I believe I have the gd library installed-- Is anyone familiar w/ graphing? Also, is there anyway to put a column of dates in order in mysql?--I was looking to see if there was maybe some kind of function.
  6. no i'm really just returning the last cell in my column--which doesn't come close to what the avg should really be-- i'm just confused. is there any other way to do this?
  7. Okay--I switched to mysql_fetch_assoc but it only return the last number in the column. I wrote the code 2 ways and I received the same result. Any suggestions? 1: $query = mysql_query("SELECT avg(More_Metrics.Days) AS columnaverage FROM More_Metrics WHERE More_Metrics.Topic_Title='$title'"); $array = mysql_fetch_assoc($query); $totalaverage = $array[columnaverage]; echo "$totalaverage"; 2: $sql= "SELECT AVG(More_Metrics.Days) FROM More_Metrics WHERE More_Metrics.Topic_Title='$title'"; $result = mysql_query($sql) or die('Query failed: ' . mysql_error()); $line = mysql_fetch_array($result, MYSQL_ASSOC); foreach ($line as $col_value) {     echo "\t\t<td>$col_value</td>\n"; }
  8. I thought that I had it...but I didn't. $query = mysql_query("SELECT avg(Days) AS columnaverage FROM More_Metrics WHERE More_Metrics.Topic_Title='$title'"); $array = mysql_fetch_result($query); $totalaverage = $array[columnaverage]; echo "$totalaverage"; I received the message: Fatal error: Call to undefined function mysql_fetch_result() in /export/home2/webpages/more_metrics.php on line 422 The error before that didnt recognize the AVG() fucntion. What am I doing wrong? It seems correct to me.
  9. Hi All, I was just wondering if someone could assist me in adding up a column full of numbers in my mysql table? I am trying to compute the average. This is what I started off with--but it doesnt return the sum. My table's name is More_Metrics. The column within my table is named Days. $query= "SELECT More_Metrics.Days FROM More_Metrics WHERE More_Metrics.Topic_Title='$title'"; $result1 = mysql_query($query) or die('Query failed: ' . mysql_error()); $i=0; while ($line = mysql_fetch_array($result1, MYSQL_ASSOC)) { echo "<tr>\n";   foreach ($line as $col_value1) { //   echo "\t\t<td>$col_value1</td>\n"; $i=$col_value1 +$i; $j=$i;///then i want to try to return $j--but i get nothing } } I guess I am a little confused.
  10. Hi All, I was just wondering if someone could assist me in outputting one of my Mysql tables as an Html table. I believe that I have to use one of the SHOW TABLE commands that mysql offers. I was thinking: $query="SHOW TABLE_NAME"; $result="mysql_query($query)"; Any suggestions?
  11. I tried using the session start function and I received these errors. I received this error when I put the session_start in the middle of the file; when I put it at the beginning of the file and try to echo out the variable that was passed, I received nothing. Anyone know what I am doing wrong? Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /export/home2/webpages/more_metrics.php:6) in /export/home2/webpages/more_metrics.php on line 21 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /export/home2/webpages/more_metrics.php:6) in /export/home2/webpages/more_metrics.php on line 21 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /export/home2/webpages/more_metrics.php:6) in /export/home2/webpages/more_metrics.php on line 21
  12. Hi All, Is there anyway that I can pass a variable to another file besides using a hyperlink or some sort of form? This is the way that I have been doing it below: (string 11 is what was passed) file 1: echo '<form method="post" action=" confirm.php?string11=' . $hlink . ' "><br><br><br /><input type="submit" name="submit" value="Review Closure" /> </form>'; echo '</CENTER>'; file 2: $title=$_GET['string11'];
  13. Thanks so much all of you that replied!!! It works like a charm now  8)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.