Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. used backtick as i was confused why you was getting a Field error.. but the key was GetCartId() is a string thus must be quoted the others are int's so no quotes were needed TimeStamp fix option #1 (via PHP code) $query = "INSERT INTO tblshoppingcart (`Cookie_ID`, `Product_ID`, `Component_ID`, `qty`, `Cart_Date`) VALUES ('" . GetCartId() . "', " . intval($ProductID) . ", " . intval($component) . ", " . intval($qty) . ", NOW())"; EDIT: option #2 (auto via MySQL) from phpMyAdmin run SQL ALTER TABLE `tblshoppingcart` CHANGE `Cart_Date` `Cart_Date` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
  2. should but Unknown column 'f765354f720f0d73ac26194fe47fb016' in 'field list'... value list i'll expect but field!
  3. you should of got a error message like this can you post the blar blar part also did you try the last code set i posted.. i know with every man, woman & dog posting it can get confusing..
  4. Okay.. try this update.. is it possible to the error.. the part thats starts query='INSERT INTO ...etc..' as the field are all static its kinda a strange message.. <?php if (isset($_POST['AddToCart'])) { $qty = "1"; foreach ($_POST["Component_ID"] as $type => $component) { // mysql_select_db($database_DM_database, $DM_database) or die(mysql_error()); $query = "INSERT INTO tblshoppingcart (`Cookie_ID`, `Product_ID`, `Component_ID`, `qty`) VALUES ('" . GetCartId() . "', " . intval($ProductID) . ", " . intval($component) . ", " . intval($qty) . ")"; mysql_query($query) or die("query='$query '<br>".mysql_error()); } //header("Location: cart.php"); } else { $ihateyou = "I HATE YOU"; } ?>
  5. first things first.. lets add some error capturing.. <?php if (isset($_POST['AddToCart'])) { $qty = "1"; foreach ($_POST["Component_ID"] as $type => $component) { // mysql_select_db($database_DM_database, $DM_database) or die(mysql_error()); $query = "INSERT INTO tblshoppingcart (Cookie_ID, Product_ID, Component_ID, qty) VALUES (" . GetCartId() . ", " . intval($ProductID) . ", " . intval($component) . ", " . intval($qty) . ")"; mysql_query($query) or die("query='$query '<br>".mysql_error()); } //header("Location: cart.php"); } else { $ihateyou = "I HATE YOU"; } ?>
  6. CR = \r LF = \n i just defind CRLF as "\r\n" the reason i double it, is mainly because it seam to work better on more mail servers.. an octet is the name of the group of 8 bits that make up 1 byte.. from the Octal number base.. i don't think i have even said that outside of a computer science class! anyways its defind from "octet-stream" but you could use multipart/related.. its all down the file type your using.. "octet-stream" seams to work on 99% of them
  7. allow_url_fopen is a secuirty risk (when used incorrectly) only differents it can cause major problems if not filtered, example your find you probably won't have allow_url_fopen CURL CRON get one with register_globals turned OFF... magic quotes are a pain.. i think its better to filter myown code than have magicquotes mess it up for me..
  8. Side Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically.
  9. Okay.. Multiple extra headers should be separated with a CRLF (\r\n). Encoding should be base64 if your attacking a file i encode it ie <?php $fp = fopen($file,"rb"); $fcontent = fread($fp ,filesize($file)); fclose($fp); $content = chunk_split(base64_encode($fcontent)); ?> as for the OCTET.. well the data may not be text only, so octet works better.. I think i covered them all!! let me know what doesn't make sense
  10. FYI: you could also do this (if you want to use an array) <?php $mypic = array("1","3","7"); $rand = array_rand($mypic); echo $mypic[$rand]; ?> EDIT: also rand does NOT Require a min & max, they are optional but in phpQuestioner, code it should be rand(0, count($mypicks));
  11. $body .= "Content-Type:".OCTET."; name=\"$file\"".CRLF; $body .= "Content-Transfer-Encoding: base64".CRLF.CRLF; $body .= "Content-Disposition: attachment; filename=\"$file\"".CRLF.CRLF;
  12. like phpQuestioner i can not recommend any.. but this may help http://www.0php.com/free_PHP_hosting.php Byet Host seams to be the best!
  13. have you checked the XML file ? the routine that creates it ? could be charset.. without more info. its going to be guesses
  14. yes it would cause a spike, best bet would be create a queue, and then have a cron to run convert. also detect if its already running..
  15. Second works for me, due the limited data, thats should NOT be too stressfull on the system.. i would probably have a table with ID, UserID, GameID & DateStamp then you can check like SELECT count(*) as TimesPlayed WHERE UserID=$uID AND GameID=$gID AND DateStamp=CURDATE(); .. at the end on the week/month you could just use TRUNCATE TABLE, to clean it up (for a quickness) EDIT: missed the NOT.. LOL
  16. read last post in this thread http://www.phpfreaks.com/forums/index.php/topic,163402.0.html
  17. another post (same idea) http://www.phpfreaks.com/forums/index.php/topic,161173.0.html EDIT: just did a search for ffmepg
  18. use System() or exec() and readup on ffmpeg command lines
  19. it would probably be better to move this to third party also do you have the latest version?
  20. where did you get the class from ? i assume theirs also a "setCost()" but without more details its going to be hit & miss
  21. Well your not using the class correctly.. the way your using it your $totalCost would have to be worked out like this $totalCost = $item + $item2;
  22. you could try changing the null's to 0 ~OR~ <?=!is_null($item->getCost()) ? $item->getName() : ''?> <?=!is_null($item->getCost()) ? '$' . $item->getCost() : ''?> <?=!is_null($item2->getCost()) ? $item2->getName() : ''? <?=!is_null($item2->getCost()) ? '$' . $item2->getCost() :''?>
  23. Maybe you should read this MySQL Insert look for "ON DUPLICATE KEY UPDATE" it may help.. you could use a RegEx to convert Insert to Update, Hope this helps
  24. telling us the "problem" may be an idea!
×
×
  • 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.