Jump to content

j.silver

Members
  • Posts

    142
  • Joined

  • Last visited

Everything posted by j.silver

  1. That is true. I am trying to compare bootstrap vs css/media queries only in developing a responsive website. Do you see cases where a developer would tend not to use bootstrap (if one knows bootstrap) in preference to using css/media queries only in coding a responsive site?
  2. Dear all, Since bootstrap has container and container-fluid classes, does a heavy lifting, and is easy to use, I am inclined to think that css's media query has no advantage. I'd appreciate sharing any opposite opinion that sees usefulness/advantage in media queries.
  3. I meant one example of when would I use $a = NULL; instead of $a = '';
  4. Many thanks davej, justsomeguy. and Ingolme. The difference is now clear as well as when to use each. The difference between setting the variable to NULL and setting it to an empty string is also clear theoretically, however, I am comfortable with using the empty string but I would love to see one example of how to sett the variable to a NULL value but not to an empty string.
  5. Dear all; Is there any technical difference between initially setting a variable to false or setting it to an empty value at the beginning of a script, i.e., $x = false; vs $x='';
  6. Many thanks davej and justsomeguy Can I conclude that from now on I should use InnoDB in all types of tables and never use MyISAM, or there is still usefulness in MyISAM for certain types of tables?
  7. Better reputation in what scene? My understanding is that InnoDB takes more space in the server and is slower than MyISAM.
  8. The example is not telling whether or not the images must be secured.
  9. Dear all, For photo gallery tables (named: gallery_album, gallery_image, gallery_relation), I have seen a recommendation to use InnoDB engine in preference to MyISAM. I thought MyISAM would be the choice for all tables but tables for transactions. Do you agree with the recommendation to using InnoDB for photo gallery tables and why?
  10. Many thanks for your clarification. I have not come across how to do it the way you suggested. I would appreciate sharing any handy reliable source of example of how to do it, or I would just search the web.
  11. Many thanks Ingolme Which of the two methods (placing it inside the desired directory or your above suggestion) is better in terms of better protection or overall performance of the website or any other reason?
  12. Dear all, As you know, an .htaccess file placed in a directory to be affected (protected) is useful in websites hosted in an Appache server to protect such directories from prying eyes. But I have noticed that recommendation is to place such files inside certain directories only, e.g., inside includes and views (that contains home page, shopping cart, listing of products, etc.) directories. I thought we could as well protect all other directories should there be no downside to protecting all. Any thoughts on why we should not include an .htaccess file inside all directories will be appreciated.
  13. j.silver

    Index vs Key

    It allows to set: primary key, unique, index, and fulltext. There is no 'key' among the choices.
  14. j.silver

    Index vs Key

    Thanks. I have noticed that phpMyAdmin allows index assignment, but no key, which indicates that such slight difference is not accounted for in phpMyAdmin and both index and key are treated the same.
  15. Dear all, For an e.commerce project, I have the following for a carts table, which seem to be the practice in assigning date/time to such table: `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', What are the merits in assigning default values as such for each date?
  16. j.silver

    Index vs Key

    Dear all, I am trying to dig into the exact difference between key and index in MySQL tables. Some say they are synonymous, others give some differences. I still don't feel confident enough to decide when to use each on a table. I would appreciate if someone well-versed in their difference explain such difference and when to use each. Thanks.
  17. Dear all, Are JS tutorials of W3Schools written using the latest version of JS, known as ES6 (ECMAScript 6)?
  18. Hi all, I have uploaded an image to a folder/directory and stored its size using the $_FILES['image']['size'] superglobal. While the image source size was reading 153kb, the stored size is 157317. Why there is a difference in size?
  19. Dear all. For an image uploaded to a folder/directory and stored its name, type, and size in a DB table, what could be the merits of also storing its temporary name, noting that such temporary name is deleted by the server upon moving the image to the desired folder/directory?
  20. Hi all, In fetching a result from a table (below code), 1 is also printed after the fetched record (fetched record below). There is no 1 in the table, nor have I accidentally included it in my script. What is it and why does it appear? <?php require 'db/connect.php'; if($result = $db->query("SELECT * FROM user")) { if ($count = $result->num_rows) { $rows = $result->fetch_assoc(); echo '<pre>', print_r($rows), '</pre>'; } } ?> Array ( [id] => 1 [first_name] => Bill [last_name] => John [bio] => I'm a web developer [created] => 2016-11-21 12:50:12 ) 1
  21. $db is no more than a simple mesqli connection: $db = new mysqli('127.0.0.1', 'root', '', 'user');
  22. Hi all, <?php require 'db/connect.php'; $result = $db->query("SELECT * FROM people"); ?> I obtained a blank page running the above script, which indicates that everything is fine (path and table name are correct). I then removed the * from the query to see if it would report an error, but it did not. I added print_r($result); and run it. Nothing has changed. I included the * and run, it reported the number of rows and columns in the table. Why there has a been a lack of error reporting in this instance, noting that the ini file is configured to report all sorts of errors, even the warnings and notices (and it is reporting all that in other scripts)?
  23. j.silver

    Error Reporting

    Many thanks justsomeguy Very informative and helpful. Do you think receiving error messages via email has a potential risk, e.g. from hackers, and it should be avoided? Is checking errors through FTP 100% safe, or there could be a chance of hacking?
  24. j.silver

    Error Reporting

    Many thanks dsonesuk I would appreciate further elaboration on what is the best practice to completely disallowing error reporting to users, while reporting it to admin., and what is the preferred method of reporting same to admin., email or other methods? Code sample would be very useful. Thanks.
  25. I'm not familiar with Node JS. What I am trying to get at is that if there is a block of code written in PHP7, and the same block is written in JS. If both are made to run on the same server, which technology executes such code and outputs result faster?
×
×
  • Create New...