Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by benanamen

  1. I had edited the post when I spotted the error. Go back to the previous post.
  2. Depends on how get_the_title() is structured. Does it end with return or echo? If it is return then $content .= "<td><a href='http://www.google.com/search?q=". get_the_title()."'></a></td>";
  3. Your credentials were also emailed to the 198 followers of this particular forum.
  4. You have a bigger problem. You just gave the entire world login credentials to your server. Bad move! Besides that, your code is all kinds of wrong. Too much for me to want to get into. I will leave that for others.
  5. PRG - Post/Redirect/Get https://en.wikipedia.org/wiki/Post/Redirect/Get
  6. Tabs are tabs. From Mobile on up tabs will still act like tabs. If you want an accordion use the accordion. If you want the tabs to magically become an accordion, bootstrap doesn't do that. You would probably have to use some JavaScript to hide the tabs and replace it with an accordion. If you know of a site that behaves the way you want post it here and I may be able to help you figure out how it's done.
  7. That is bootstraps default behavior. You don't need two different designs. Bootstrap is mobile-friendly,actually mobile first is the term and will scale automatically.
  8. Yeah, that's the thing with noobs (Don't mean it in a bad way), they don't know what to ask or provide. It the typical XY problem. http://xyproblem.info/ OP sees a particular problem and asks how to fix that problem not realizing it is just a symptom of the real problem. My experience says there is a very high probability that the DB structure is wrong which is why I asked the OP to provide it. I am sure you would agree that the DB is the first thing to ensure is correct and if not to fix that first.
  9. @Zane, the if is just a quick fix band-aid for what is pretty clearly a bad database design. @wkilc, if your wanting to get things done correctly, post your DB schema and we will help you get this right from the ground up. Your Database is the foundation on which you will write all your code. If that is not right, the code you build on it will not be right and you will continue to run into unnecessary problems.
  10. If you have a properly normalized database with one table with a list of car names you shouldn't have any empty rows. You would also want to be using the ID of the car name not the actual name itself for the value. Additionally, the file name does not belong in the value.
  11. Your code is obsolete. ereg and MySQL_* have been completely removed from PHP.
  12. I told you exactly where the problem is and what the problem is. Your first Echo doesn't close.
  13. You are missing the closing quote and semicolon on your echo.
  14. <?php //do action( '' ); ?> Copyright © <?php echo date("Y") ?>
  15. Oh where to start... You are using obsolete code that has been completely removed from Php. Hiding errors with the @ is a no-no. If you have School1 and School2 in your DB, your database is wrong and needs to be re-worked. You are directly injecting user supplied data into your code and open for an attack In short, your database and your entire code needs to be re-written. Look up and learn Database Normalization and study this PDO Tutorial https://phpdelusions.net/pdo What you have is junk and dangerous and should not be used whatsoever.
  16. If you want a complete correct answer you will need to post your DB schema.
  17. Get in the habit of always using lower case for names and variables and seperate_multiple_words_with_an_underscore.
  18. Session_register and register_globels is obsolete. If you checked the manual you would see big red boxes telling you so. I am quite certain your code is obsolete as well.
  19. What code? I dont see any.
  20. 5.6 minimum
  21. You have an extra } in your code.
  22. Found the problem. In the schedule table, a lot_id can be there more than once. Mysql is using the last rows schedule_date to calculate. I will have to add one more piece of criteria to use the correct row. @Kicken, thanks for your help.
  23. Thanks @kicken. That has me on my way. It did update many records but there are many where the datediff is not correct. I even deleted all the order_by_dates and ran the UPDATE and it still creates some dates that are not the correct difference. I even hard coded the days to subtract 21 days from schedule date. I am getting dates from -67 to 432 days difference. Very confused. I broke down the update query to as simple as possible and still same result. Using: UPDATE lot AS l LEFT JOIN `schedule` AS s ON s.lot_id = l.lot_id SET l.order_by_date = DATE_SUB(s.schedule_date,INTERVAL 21 DAY)
  24. I have an order_by_date date field that is generated based on a schedule_date. The order_by_date is the schedule_date minus days_to_order. Bad data got in order_by_date so I want to update order_by_date in all rows. The following query will show me what the correct order_by_date should be. How do I take the result correct_order_by_date and update order_by_date with that value? *** As I was writing this, it occurred to me a calculated date does not need to be stored in the DB, nevertheless, I would still like to know the technique to do this. See Attached image SELECT DATE_SUB(s.schedule_date, INTERVAL d.days_to_order DAY) AS correct_order_by_date, l.order_by_date, s.schedule_date, d.days_to_order FROM community AS c LEFT JOIN block AS b ON b.community_id = c.community_id LEFT JOIN lot AS l ON l.block_id = b.block_id LEFT JOIN `schedule` AS s ON s.lot_id = l.lot_id LEFT JOIN days_to_order AS d ON c.days_to_order_id = d.days_to_order_id WHERE s.reschedule_date IS NULL AND l.order_by_date IS NOT NULL AND l.lot_type_id > 2 AND s.schedule_date IS NOT NULL AND c.community_type < 3 AND l.active = 1 AND l.order_by_date > s.schedule_date
  25. I for one don't understand what you're trying to do. What is the overall task at hand that you think this is the answer for??
×
×
  • 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.