Jump to content

gw1500se

Members
  • Posts

    1,029
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by gw1500se

  1. Its possible that simple_html_dom is not installed on that server. Do you have error reporting turned on?
  2. <div class="section" style="<whatever css style you want>"> <?php if(isset($_SESSION['uid'])) { echo 'Hello,'; echo $_SESSION["uid"]; } ?> </div>
  3. I'm not sure if this possible but I have a bunch on links on my page that are jpg files. When I click on the link it opens the image in a new window which is exactly what I want. However, I need that jpg to automatically resize as if there were an img style attribute: img { max-width=100%; height=auto; } Is there a way to do that without creating an HTML page for each JPG with an img tag in it? TIA.
  4. This is really a MySQL question. I'm not a MySQL expert so I don't know where latitude and longitude come from. I assume they are columns in your data base. I've never used a calculated value for ORDER BY rather than a column value. In my scenario I don't store that in my database. I just pass the zip codes to the MapQuest API and get the distance when I need it. If it were me I'd put the zip codes in an array, then add the distances to that array from the API and sort the array on the distances.
  5. I do something similar and use the MapQuest API. You have to sign up for a key but it is free.
  6. round(floatval($item['in_bytes'])/1000000,2); I used 'floatval' instead of 'intval' since that is what 'round' wants. The 2 gives 2 decimal places but you can use what you want.
  7. Simply divide it by 1000000 then round to get the desired precision. You may need to use intval to make the string an integer first.
  8. Here is a handy tool to validate your HTML.
  9. If I understand, you are really using the wrong approach. You really want to use preg_match and a regular expression. I am not a regexp expert so you should ask tor the expression in the regexp forum.
  10. $chunk is whatever you name the array you split into. RTFM.
  11. $array1=$chunk[0]; $array2=$chunk[1]; Assuming it was split into 2 chunks.
  12. You need to change your loop from a while to a for. for(i=0; i<$rowCountUpdate; i++) What seems strange to me is that you are not changing your query parameters on each pass. It looks like you are always updating the same row thus the infinite loop.
  13. Your syntax was just messed up. You can see how much simpler Barand's code is. There are a couple of ways to do the same thing but none are complicated. When you find yourself adding too many quotes and other symbols you are probably on the wrong track. PHP recognizes anything that starts with $ as a variable and does substitution. If you need to have a string that starts with $ and do not want substitution then you need to escape (\) the $, thus \$whatever.
  14. You are not passing $Connection to the function so it is undefined. If you had errors turned on you would have seen that.
  15. First, please use the code icon (<>) and select PHP for your code. The formatter makes it much easier to read. As for your question, PHP has a function to handle json called json_decode. It will create and associative array so you can access whatever you need easily.
  16. Excuse me but "all of the experts?" Bull$hit. Requinix IS an expert as well as Kicken. You would be foolish not to heed their advice and it sounds like you will be foolish.
  17. Why in the world would you store it that way in the first place? Thought it may work now, down the road who knows what kind of problems this will present. Now is the time to fix the schema so it makes sense.
  18. You can't just copy code and necessarily expect it to work. You need to understand the code presented and then implement your own.
  19. Are you logging in using the same user (root)? Also is the PHP script running on the same server as MySQL (localhost)?
  20. Perhaps not so obvious. The error message indicates that the database it is trying to open is 'lr'. If the global was returning something different, it would not show up that way in the error message. That database must not exist at least in the way it is being referenced. Again a 'show databases' would verify that.
×
×
  • 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.