Jump to content

Muddy_Funster

Members
  • Content Count

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Muddy_Funster last won the day on April 25 2017

Muddy_Funster had the most liked content!

Community Reputation

99 Excellent

About Muddy_Funster

  • Rank
    Prolific Member

Contact Methods

  • Website URL
    http://muddy-dev.blogspot.com

Profile Information

  • Gender
    Male
  1. No, you can't bind column names as parameters. This is going back to what I said about maintaining dynamic where clauses.
  2. And your point is caller? The link in my sig is to a reputable blogging host, not some random zip file that could contain god knows what viruses. I don't ask anyone to click the link in my sig and it's certainly not a requirement that people do it in order for help to be provided. You're comparing apples to oranges. To be honest I had forgotten it was even there, now you have reminded me I'll probably remove it as most of the content is seriously out of date. That's Right, it is "PHP Coding Help", but you didn't post any code and your not asking for help, your asking for some
  3. First post on a public forum and you're asking people to download a zip file? Sorry, I don't think so.
  4. I always find html localStorage ( https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API ) is a quick, easy (and yeah ok, kinda dirty) way to have JS persistence, sessionStorage would probably be better for your use case though.
  5. Exactly what I was going to suggest next. If the data stored isn't accurate then you should be sorting that, not trying to make a workaround for it. Also, your countdown is granular to the second and your date is only to the day. The whole field type should be changed to datetime and the insert script is what you should be looking to alter, not the display one. What do you mean? It already is, that's kinda the issue.
  6. I'm still not sure about the code you are using. var is used in JS and the $ prefix is used in php, so it looks like you are mashing the two together. What is $time? and where does it come from?
  7. I think the issue here is really just coming from a lack of understanding the capabilities of the processes you are working with. The following is a basic representation of the processing when using a web browser: Step 01 > Server gets an http request from client Step 02 > Server runs php using any header information passed in the http request Step 02.1 > Server connect to backend storage Step 02.2 > Server retrieves data from backend storage Step 02.3 > Server processes data from backend storage Step 03 > Server finishes running php and buffers result Step 04
  8. <?php while($row_product1 = mysqli_fetch_assoc($result_product)){ every one of those lines is a loop, I was saying that by applying the order to the actual query you will only need one loop, not one for every value in specials.if you want a better answer ask a better question: Generaly include: 1>what are you trying to accomplish - in detail 2>what result to you get just now Specifically for this question include: 1>what order are you trying to get the products in? 2>what is stored in specials if it's not 0,1,2,3,4,5 or 9 ? 3>are you expecting to get results from
  9. change query string to: SELECT * FROM products WHERE NOT specials='0' AND product_publish='y' ORDER BY specials ASC then just echo out from a single loop.
  10. @mac_gyver, Just looking over that UPDATE syntax and something's bugging me - what case would cause someone to want to ORDER BY during an update? O_o
  11. Quite welcome, could you mark post as answered please if there's nothing more you need on it?
  12. ok, change the following and let us know what it gives you: $id = $db->lastInsertId('id'); becomes $id = $db->lastInsertId(); var_dump('last-insert-id = '.$id);
  13. For that scenario you would be better using the method @barand has described, that way you only need to loop through the 200 id's that you want to update, rather than having to loop through the 1000 products and then the 200 id's. assuming your 200 id's are in an array: //load in your xml element as before - going to call it $xml in this //also going to add a bit to build some of the query string to save another loop $setStr = ""; foreach($idArray as $key=>$id){ $prod = $xml->xpath("/eshop/product[id={$id}]"); $update[$id] = $prod->price; $setStr .= "\tWHEN {$id} THEN {$pr
×
×
  • 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.