Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Would that be ORDER BY last insert/updated ID? Can you point me to an example? Thanks.
  2. Hello everyone, Just like this forum when a thread is updated and move to the top of threads made by someone posting in that particular thread and appears first in the list of threads made for that particular forum, how do we make a row become the first row for a particular table? I hope my question is clear. Thanks.
  3. I still have the 'habit' I guess we can call it of using div's with id's, would it be recommended to switch over to using the HTML5 tags for the sake of SEO, screen readers, future technologies? Thanks.
  4. It may not be it but the code looks like something from a w3schools tutorial he came across or a variation of one that he may have edited himself for understanding/learning.
  5. No need to feel silly. We live and learn.
  6. myArray.constructor.toString() returns this string: function Array() { [native code] } and "Array" is at the 9 index when you have this: myArray.constructor.toString().indexOf("Array");
  7. Yes. I was thinking since a URL can contain many %20, that would be ideal (to add the character class [] ) but upon further observation it would also remove the 20 from a URL like mypage20.php for example and that's not good. So for the sake of understanding, would have this been the correct way?: $new_url = preg_replace('/%20/', ' ', $new_url); Thanks
  8. Try: $new_url = preg_replace('/[20%]+/', ' ', $new_url);
  9. Are you getting any errors? Try adding this to your code after execute() to see if you get any output: echo $dbh->error;
  10. Merry Christmas! To others of different beliefs, blessings to you all as well!
  11. Try: $query= $dbh->prepare("INSERT INTO houses (location) VALUES (?)");$query->bind_param('s', $location);$query->execute();
  12. Hello, Of course it is good to use prepared statements for user input but I thought for the sake of asking if it is necessary to use prepared statements for internal SQL statements? I read some time ago it is best to use prepared statements for SQL even if they are not from users etc (internal SQL statements) or/and even if the SQL statements are for an admin area where you know you can trust the input, say if it's an area of the site you only have access to for example. I just thought I'd ask and get some perspectives/advice on this. Thanks.
  13. A way to tell if an image is landscape or not is.. usually images that are landscape have their width larger than the height. You can check to see if that is the case and if so, it's a landscape. To be more precise, I would see what the difference is between the width and height. So if an image is 800 width and 400 height, since the width is obviously larger than the height, it's a landscape image but check the difference which is 400 because in some cases, you can have an image where the width is larger than the height by only a small amount like 500 width and 300 height, 200 difference which this can be considered a portrait image really. So check to see if the width is larger than the height and also see what the difference is and based on your preference of what you want to be considered a landscape, consider that image 'landscape' then. So another example, user uploads an image of a width of 900 and height 500, obviously this is a landscape most likely but say you have 300 of what to check difference from and if the difference is larger than 300 which it is in this case (400), it's landscape, if it's less than 300, you can consider it a portrait. It's all in your preference as to what you want to consider a landscape or not. I would though first resize all the uploaded images if they are larger than a specified amount for the site because these days from digital cameras, phone cameras, etc, images can be very large in width and height with dimensions like: 3434 by 2213 or something of the like. Good size image dimensions these days for website displaying if larger than the following dimensions is about 700 or 800 px width. So if the uploaded image width is larger than 800, I would resize the image to 800 px. (The height is automatically calculated to preserve aspect ratio). Hope this was of some help.
  14. Hey everyone, Is anyone here familiar with linux? I installed a program from source and I would like to upgrade that program to the latest version. Usually I would just use the yum utility to install and/or remove a program but sometimes a program has to be installed from source. I asked this question in the CentOS forum but it seems a question like this is... I guess.... vague or something. Perhaps it is but i thought asking there would be the best place. Here is the thread: https://www.centos.org/forums/viewtopic.php?f=14&t=49401&p=209704Basically everything you need to know of my question is there. I am familiar with linux but not enough to go ahead and try things on my own without some guidance/direction if I am not sure of something. I searched google as well. (that was the first thing I did) I thought I would ask around here as well incase maybe some of you are familiar with this kind of stuff. Thanks in advance.
  15. Yes it's possible. Also, you can buy the domain name and just hold onto it until whenever you're ready to use it for a website.
  16. When you call the isWorthALook function with it's first argument passing the prequal function where as the the argument for the prequal function is an object of one of the car objects like taxi, didQualify becomes true or false depending on what's returned from the prequal function. If didQualify is true, you get the console.log of: console.log("You gotta check out this " + car.make + " " + car.model); If not true, you get console.log: console.log("You should really pass on the " + car.make + " " + car.model); Hopefully this helps.
  17. Look at this update; http://jsfiddle.net/3kksmag5/10/ See the changes. Use offsetLeft and offsetTop to get left and top values. When setting the left and top in the ahoj function, instead of the left and top margins, set the left and top positions: y.style.left, y.style.top. Also since you're moving the red box div around, make sure to set position to absolute in CSS. Hopefully this answers your question.
  18. Change document.onmousemove=ahoj(); to document.onmousemove=ahoj; and see if that works.
  19. Have you looked into how forms work yet?
  20. Don E

    Websites vs. Apps

    Yes seems like it is a blurring of definitions. davej made some good points. It seems they are for the most part websites. It's as if the app icon on users' phones is basically like a shortcut to your app(website). One thing I see that can differentiate an app from a website is that some apps can access the users' phone operating system functions perhaps which requires a developing language that can allow that to take place.
  21. Don E

    Websites vs. Apps

    Yes I'm aware that apps are basically webpages because HTML,CSS and JavaScript can be used to make phone apps(http://mashable.com/2012/07/11/language-app/). The question was more of.. should one aim at that intention instead of geared toward traditional website approach nowadays because of the popularity of apps, but anyhow, I think my question is/was already answered for the most part. Thanks.
×
×
  • Create New...