Jump to content

Stefany93

Members
  • Posts

    261
  • Joined

  • Last visited

Everything posted by Stefany93

  1. WOW - longest query I have ever seen. Beautiful!
  2. Don't use id as a flight number - make a new key and set it as primary. Always use a primary auto incrementing key in any table. I am sorry, I spelled it wrong, it is many-to-many-relationships table (junction) that is if you went with a different DB design - personally I wouldn't want the codes of the airports being repeated in multiple rows, but would prefer ids and then having them bridged in the junction. However, Barand's answer is better since it uses your existing design. As for the # FRA, ATH # is comment in SQL. I was trying to show you the result of the query, as usually in programming tutorials they will use // to show the results of a statement. I'd also suggest using more descriptive column names - I couldn't figure out what flt_num stood for, for the longest time.
  3. Is this your final script? You want to notify the user via email, no? Because you are not sending an email here, or outputting anything. Check in the phpMyAdmin SQL console your query to make sure it is correct.
  4. I suppose you will need a one-many-relationships (junction) table to prevent duplicate data. But let me show you the simplest way: Let's say you want to fly from JFK to SOF You have a table called schedule below: id, airport, flies_to 1 SOF FRA 2 FRA SOF 3 JFK FRA 4 FRA JFK 5 ATH SOF First you check if JFK flies directly to SOF and if the query returns null, then you run this one: SELECT airport FROM schedule WHERE flies_to = 'SOF' # FRA, ATH
  5. I doubt they will put code that is "bugging beyond belief" in the textbook as you said, since technical books to through a lot of checkups before they are published. Since you said it is 2nd edition, maybe the environment you are testing the questions is too new for them? Either way, if there are really bugs, then enable error display and act accordingly.
  6. ^^ I read somewhere that only if the options are more than 6, then you use a drop-down instead of radio buttons. Since you have 3 options, use radios.
  7. Welcome I am the opposite - I am super bad at design but good with the back end stuff.
  8. ^^ Actually I find the pop-up quite useful if I am writing something and accidentally click the close button on a tab or browser (pls don't hate me, lol) especially if there is no auto safe. As for the op, it is not possible to write to add a custom message onbeforeunload or any event that is triggered when the user wants to leave. You can add some text (on few browsers) additionally to the default message and that's it. Browsers do that for defense.
  9. ^^As the colleague above suggested, use a cron job, but be extra careful when writing the code for it. Make sure you log and email every error because if something goes wrong you won't be able to tell until users start complaining. And make sure to set the server to run the cron during the night (remember that the time in the server might be different than your current timezone)
  10. Thank you so much guys, you have been very helpful. I guess I was looking for "blocking" button but the "ignore" one does the same thing and I completely missed it. Thanks again.
  11. Hello, There is a user here who is harassing me. Every time I make a post, he is the first one to reply and to call me names, etc. I want to block him so I no longer read this bullshit and keep my blood pressure low. Is there such an option? I can't find it. Thank you.
  12. It's possible, if it is an old edition. OP, which year is the book published?
  13. Stefany93

    MVC

    Kuddos for writing a custom one to understand it. 99% of the programmers would have used a shitty ready made system to understand MVC and would have been more confused at the end. You can think of a controller as a way to have all your pages generated from index.php file while having them in a physical state in the /views folder. It is a confusing concept and everyone have a different opinion about MVC. You dont need MVC to write good code.
  14. Yeah also you have too many duplicates in your DB. What is Generic lighting hanging clamp ? Is it a product name? Then make another table and then connect it with an ID.
  15. OOP requires writing more code, which in turn slows down your code execution/website. Hence why it is used only if you are building big websites (e-shops, forums, etc) Same with Java, one of the reasons it is so extremely bulky is because you can only write it in OOP. But if your DB queries are slow, it is probably the DB's design fault or the way you are fetching the data needed. Make sure you use indexes where possible, avoid duplicate rows at all costs and use junction tables for many-to-many relationships.
  16. Hello, I am sorry if I post in the wrong section, but I have 2 tickets for Web Summit in Lisbon in November -> https://websummit.net/ The price is $150 per a ticket, the price on the website is (in this time of writing) $828.00 Thank you in advance and sorry again if I post in the wrong section.
  17. What is the isInjected function for? Are you using PHPMailer? I don't have problems with it sending well encoded HTML emails and they appear very well on all platforms I have tested.
  18. I took pictures of the projects I made with SnippingTool and this is the best quality I can make... The only other pic is of me & my husband which I don't think the quality matters much.
  19. Your query doesn't work because you included the DISTINCT keyword, which only fetches unique rows from the DB. And rows of the columns you are fetching are not unique. So, with the query you used above, put the result in a mysqli_fetch_all method and when all the rows are in that array, loop through inside the table like: $data = // your result in a single associative array foreach($data as $key => $value) { echo "<td>".$value['brand']."</td>"; echo "<td>".$value['category']."</td>"; echo "<td>".$value['product']."</td>"; } Just a tip: You should always strive to have as little as possible duplicate data in your DB. Sometimes it is not possible, but in many cases in can be avoided. In your case, you have set another table with the description of the brand, category and product and just point to the other table with a foreign key. This way when you need to update either one of the columns, you will only need to update the other table.
  20. Howdy, My name is Stefany and I am a web programmer. Over the past 5 years I have created more than 40 websites and I am truly confident to create any website you can think of. I have created forums, web-shops, social networks, newspaper websites, dating websites and many more. I know HTML5, CSS, JavaScript, PHP, Perl, Java, MySQL, MSSQL, SQLite, WordPress, Joomla, CodeIgniter, REST, SOAP, OsCommerce, XML, AJAX. Portfolio - www.stefanynewman.info Skype - age_of_empires3 Thank you very much! Best Regards, Stefany
  21. Use PDO and catch Exceptions. That way it will be much easier to debug.
  22. Thank you, could you elaborate?
  23. He said he can't modify the DB. To the OP -> Remove the inline stylings. Use CSS. It will be a pain to modify the code later on.
  24. Well, if you are using sessions, it is easy. Just put $_SESSION['season'] = 'Summer' or $_SESSION['season'] = 'Spring' in the header of the your application and then use the if statements to check the value of the $_SESSION variable. If you don't want to manually update the value of the season session, you can put it inside a switch statement
×
×
  • 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.