Jump to content

darkspire

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by darkspire

  1. not sure if you can do this in PHP alone. I would write a small vbscript or c# program to output the process list to the command line, then you can just read it into your PHP using stdin
  2. heres what I use. //mySQL.php <?php require_once('util.php'); define('DB_HOST', 'localhost'); define('DB_USER', 'root'); define('DB_PASSWORD', ''); define('DB_DATABASE', 'illumina_rpg'); $con = ""; function connect_mySQL() { global $con; $con = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db( DB_DATABASE, $con); return $con; } function close_mySQL() { global $con; mysql_close($con); } function write_mySQL( $query ) { global $con; if (!mysql_query($query,$con)) die('Error: ' . mysql_error()); } function read_mySQL( $query ) { return mysql_query($query); }
  3. FlashDevelop supports basic php syntax hi-hilighting. I used it for a while. I just tried netbeans today though. just curious what everyone else was using.
  4. does anyone else here use netbeans4php? notepad++, or somthing else... ?
  5. this is pretty decent right? mySQL_array SPEED TEST - [ 30,000 Numbers ] - SERIALIZED with BASE64 ENCODING AND GZ COMPRESSION 52.8KiB WRITE ARRAY in: 0.15 seconds. 52.8KiB READ ARRAY in: 0.03 seconds. 52.8KiB ROUND TRIP in: 0.18 seconds. (approx: 3.41 milliseconds per KiB) --- running on FIREFOX + EASY PHP 5.3.8.0 - ON ASUS G51VX - 2GHz dual core (x64) - 4GB RAM ---
  6. $date1 = date(‘Y-m-d’); $date2 = “2007-02-26″; $days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24); echo ” No of $days difference”;
  7. its a logic error... take out the elseif's and use && instead of ||. that should fix it. <?php $Cost = $_POST['fielda']; $Tax = ($Cost * .06); $Sub = ($Cost + $Tax); if ( $Sub <= 25.99 ) $Ship= 3.00; if ($Sub >= 26.00 && $Sub <= 50.99 ) $Ship= 4.00; if ($Sub >= 51.00 && $Sub <= 75.00) $Ship: 5.00; if ($Sub > 75.00) $Ship= 6.00; $Total = ($Cost + $Tax + $Ship); print ("Cost : $Cost<br> Tax: $Tax<br> Ship: $Ship<br> Shipping total is $Total"); ?>
  8. try this: <?php $Cost = $_POST['fielda']; $Tax = ($Cost * .06); $Sub = ($Cost + $Tax); $Ship = 0; if ( $Sub <= 25.99 ){ $Ship= 3.00; } elseif ($Sub >= 26.00 || $Sub <= 50.99 ){ $Ship= 4.00; } elseif ($Sub >= 51.00 || $Sub <= 75.00) { $Ship: 5.00; } elseif ($Sub > 75.00) { $Ship= 6.00; } $Total = ($Cost + $Tax + $Ship); print ("Cost : $Cost<br> Tax: $Tax<br> Ship: $Ship<br> Shipping total is $Total");} ?>
  9. hmm not sure. this may help http://txt.binnyva.com/2007/03/find-difference-between-2-dates-in-php/
  10. Hey everyone, im a php noob but so far so good. Looks like a nice forum but whats with the captcha verification when creating new threads? Dont you already have to do that to create an account? btw, Just ran some speed tests on serializing objects into mySQL if you guys are interested... --- running on FIREFOX + EASY PHP 5.3.8.0 - ON ASUS G51VX - 2GHz dual core (x64) - 4GB RAM --- mySQL_array SPEED TEST - [ 30,000 Numbers ] - SERIALIZED with BASE64 ENCODING AND GZ COMPRESSION 52.8KiB WRITE ARRAY in: 0.15 seconds. 52.8KiB READ ARRAY in: 0.04 seconds. 52.8KiB ROUND TRIP in: 0.19 seconds. (approx: 3.6 milliseconds per KiB)
×
×
  • 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.