Jump to content

me1000

Members
  • Posts

    183
  • Joined

  • Last visited

    Never

Everything posted by me1000

  1. actually that was a typo... however the "$this->" fixed it... Like I said, I figured it was a stupid mistake like that! I appreciate the assistance. Thank You,
  2. I feel like an idiot for asking this, but I need some help... I have a simple 2D array, $oObj->specailPageList = array( 'login' => 'login.php' ); Now I want to get the value of row... (in this case I want "login.php") to be returned... I just cant turn anything up! echo $oObj->specailPageList["login"]; Thanks,
  3. While it is not specifically a PHP editor Coda by Panic Software is the best editor I have ever used! I really cant even say enough about it!
  4. So this will only work if I use PHP generated dates? this could be a problem, because the date will be stored in the database, and pulled out when it needs to be calculated. EDIT: im just going to mark this topic as solved, because for the moment I can just do the math on the dates before they get stored in the DB...
  5. ok, So when I attempt to work with this, im not having a lot of luck echo date("2008-05-26", strtotime('+1 year')); from what I understand this should return "2009-05-26" right? Im getting the exact same date as I entered into it... "2008-05-26" im not sure what the problem is here though...
  6. ok thank you, I believe that was the function I was looking for.
  7. ok, so basically im out of luck making it any easier on me. At first it doesnt seem that hard, however the more I think about it, what if in those 7 days the month changes? I have to write that into my code. Now what happens if the year also changes within that 7 days too? is there no easy(er) way to manage this?
  8. I have a LAMP server, but I use MAMP for development, kind of depressed that you dont include MAMP as an option though...
  9. You are going about it in the wrong order... (without looking at any of your code) you need to upload the image before you do anything to it. Then you can resize and rename it on the server.
  10. Hello, The user will have the ability to determine the expiration period of an entry. (1 week, 2 weeks, 1 month, 2 months, 3 months, 6 months) The problem is I am unsure of how to filter the results to only show the entries that are not past the expiration. Is there an easy SQL or PHP command to convert dates to make them much easier to work with? Thanks,
  11. ok, So The user will be able to remove an entry from the database, however once they do it needs to update the rest of the entries... for example, there is an 'ORDER' column in the DB if there are 3 entries in the DB the order column would be filled out like so, '1,2'3' respectivly. however If I wanted to remove the row WHERE ORDER=1 the database will have the values to '2,3' instead it needs to update all the values that are greater than 1 and subtract 1 from them, so after you delete the row the db would be updated so that it said '1,2' again. Here is the PART script I have written so far.. $inPageID = (is_numeric($_REQUEST['id'])) ? $_REQUEST['id'] : die('invalid id'); $query = "SELECT * FROM nav WHERE ASSO=$inPageID"; $result = mysql_query($query); $blah = mysql_fetch_array($result); $newnum = $blah['ORDER']; $query = "SELECT * FROM nav WHERE `ORDER` > $newnum"; $count = mysql_num_rows(mysql_query($query)); //echo $count; //echo $query; //die; if ($count > 0) { $result = mysql_query($query); while ($blah123 = mysql_fetch_array($result)){ $newnum2 = $blah123['ORDER'] - 1; $query = "UPDATE nav SET `ORDER`='$newnum2' WHERE `ID`='".$blah123['ID']."'"; $result = mysql_query($query); $message = ($result) ? "" : 'FAIL!'; echo $message; //echo $query; } } The error im getting is... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [path...] on line 69 line 69 is while ($blah123 = mysql_fetch_array($result)){ I believe it updates the first row after that, but then it fails when it tries to loop again. Can anyone help me? Thanks,
  12. That was it, Just curious: why I couldnt run the mysql_query() function inside of the _fetch_array() function? Thank you
  13. So basically my while loops will never stop... on top of that it looks like my query (only when ran from the browser via this script) will only return one entry. here is the loop $query="SELECT * FROM nav ORDER BY 'ORDER' ASC"; //echo $query; while ($row = mysql_fetch_array(mysql_query($query))) { echo '<div class="navBullet"><a href="http://google.com">'.$row['ASSO'].'</a></div>'; } im sure it is just something stupid that im doing, but I cant seem to find it. I know the query is good, because I have ran it through my sql manager, and it returned the correct entries.
  14. nope it doesnt, it is basically what I already posted; I just forgot to add the last ) at the end when i removed a good portion of the array. EDIT: nevermind, I think the problem was that the table wasnt long enough. so the library I am using to create the pdf just hides it.
  15. array_push($arrayAlpha,array('Name'=>$Row['name']." ".$Row['name']); That isnt all the code but it is what is causing the problem, any time I add a 2nd $Row variable it causing nothing to display. As long as there is only one (regardless of which one it is, for example it could be $Row['id'] or $Row['content'] ) it displays fine, the code I posted above is calling the same variable $Row['name'] however it doesnt display, but if I used array_push($arrayAlpha,array('Name'=>$Row['name']." "); it would work, even with the space after it. Any ideas how to fix this?
  16. This was just a snippet of code, the array is fine because I was using random data in it before. this should be at the top of all of it, I just forgot to select it when I copied it, $data4 = array( /code]
  17. array('CourseName'=>'','number'=>'','Complete'=>'','expired'=>"",'inProgress'=>"") // make the first row blank, foreach ($arrCourses as $strKey => $strRow) { // Total Enrolled $strQuery = ""; $intEnrolled = $Database->db->MyQuery($strQuery); $counter['1'] = $counter['1'] + $intEnrolled; // Completed $strQuery = ""; $intCompleted = $Database->db->MyQuery($strQuery); $counter['2'] = $counter['2'] + $intCompleted; // Expired without Completing $strQuery = ""; $intExpired = $Database->db->MyQuery($strQuery); $counter['3'] = $counter['3'] + $intExpired; // In Progress $strQuery = ""; $intProgress = $Database->db->MyQuery($strQuery); $counter['4'] = $counter['4'] + $intProgress; ,array('CourseName'=>$strRow['series'] ." ". $strRow['number'] ." (". $strRow['odid'].")",'number'=>$intEnrolled,'Complete'=>$intCompleted,'expired'=>$intExpired,'inProgress'=>$intProgress) } ,array('CourseName'=>"TOTAL",'number'=>$counter['1'],'Complete'=>$counter['2'],'expired'=>$counter['3'],'inProgress'=>$counter['4']) ); So basically I need the foreach loop to fill out the array, but from the php error im getting back Im going to guess that PHP doesnt let you do that. So is there a way I can? Thanks, EDIT: By the way, I removed most of the queries prior to post because it is pointless to post them, but there error im getting is so I know the problem is the loop!
  18. QUESTION if I may: Why store the embed code? why not just the URL which can then be used in the embed code generated by PHP. This will make it more flexible in the future, take less space on the server, etc...
  19. ok, the code works now, I just coped the whole charts.php page into the page that was including it which brings me to my next question. Can you not send arrays through a function? for example if my array were, $data['1]=123; $data['2]=456; $data['3]=789; and I send $data through the function functionName($data); EDIT: nevermind, because I am still sending the array data through the function! I really have no idea what was going on... does that not work?
  20. I dont know where you see image_draw() at, but I believe the image_graph class require the GD library...
  21. When is their new version coming out, and I heard they've supposedly fixed a mess of vulnerabilities, errors, etc..of that sort? but I agree, phpBB boards would be a good start. PHPbb3 came out not too long ago...
  22. I believe it is $Graph->add() which sends the headers, Ill check tomorrow for sure, but Im about 95% sure graph.php is just a bunch of classes in which you must call in order for anything to execute. however the header must be sent sometime to create the PNG... right?
  23. Hi, (all of this is using the PEAR library image_graph http://pear.php.net/package/Image_Graph ) I have a file where I need to create several different graphs all the same kind with limited redundancy. So I have created a function where I pass an array of data through it to create the graph. this is what I have that generates the file, function makePieChart($data){ require_once 'Image/Graph.php'; // create the graph $Graph =& Image_Graph::factory('graph', array(400, 300)); // create the plotarea $Graph->add( Image_Graph::vertical( Image_Graph::factory('title', array('OnDemand Overall Status', 12)), Image_Graph::horizontal( $Plotarea = Image_Graph::factory('plotarea'), $Legend = Image_Graph::factory('legend'), 70 ), 5 ) ); $Legend->setPlotarea($Plotarea); // create the 1st dataset $Dataset1 =& Image_Graph::factory('dataset'); foreach($data as $value){ $Dataset1->addPoint($value['name'], $value['number']); } // this gets the $data array from the PDF file, and loops it to create $Graph->done(array('filename' => 'output.png')); } I took out a lot of stuff from it, because I didnt see a need to post it but it works in generating a file. now here is the problem, when I call the function from another file with this code, include("charts.php"); makePieChart($data) ; it gives me an error, saying the headers were already sent. So the script is making the php file act as a png correct? is there a way so that when I call up the function it just creates the new output.png file? Thanks,
  24. create a table for friends, columns like: ID, USERID, FRIENDID it isnt very efficient but it will work if your user base isn't too large. for messages, ID, FROM, TO, READ, DATE, MESSAGE READ is set to a 0 as soon as a message is sent then set to 1 when the recipient sees it. these things are complicated, you wont find too many people giving tutorials on it. There is a reason MySpace and Facebook make millions of dollars ever month!
  25. http://postbeam.com.au/gallery/albums/Colonial_Homes/photos.dat.77 that file? gallery/albums/Colonial_Homes/photos.dat.77
×
×
  • 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.