Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About ScoobyDont

  • Rank
  1. Bitterly disappointed that you need to get your crystal ball out, as an administrator you should know they have bought a Magento 1.0 ecommerce site from theme forest/ebay with a special offer of 42 addons/plugins And what chokes me even more, you have not even offered 2 lines of code to bring the load times down.
  2. Thank you, I fully understand that and thank you for your input, but everything I seem to do with this framework seems to give me problems. So I have ditched it, so I no longer need any more answers on the topic. Yesterday I carried out some testing with Laravel, Cake and CodeIgniter and out of the 3 I personally like CI so going to run with that. Thanks again for all your help
  3. Oh great, to be honest it was to help me start to understand MVC of which I first thought it seemed quite simple until I tried to do a simple bloody count Now I am starting to wonder what ever was wrong with <? $carcount = $db->query("SELECT id FROM vehicledetails WHERE id=id"); $carscounted = $carcount->rowCount(); ?> It was a course on Udemy,(£9.99) and to be fair I thought it had given me an insight into MVC but by your response maybe not. OT but which framework would you recommend for a beginner/advancing php'er
  4. Something like this should work <?php foreach $rows as $row) : ?> <div class="card"> <h4 class="card-title">Card Title</h4> <p class="card-text"> User: <?php echo $row['name']; ?> <br> Date: <?php echo $row['date']; ?> </p> </div> <?php endforeach; ?> Obviously you need to style the card as you see fit
  5. Wow thank you for your detailed repsonse, The MVC is one I followed on a tutorial online, here is a copy of my Database Lib <?php /* * PDO DATABASE CLASS * Connects Database Using PDO * Creates Prepeared Statements * Binds params to values * Returns rows and results */ class Database { private $host = DB_HOST; private $user = DB_USER; private $pass = DB_PASS; private $dbname = DB_NAME; private $dbh; private $error; private $stmt; public function __construct() { // Set DSN $dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->dbname;
  6. hi, I have changed the code a little bit and put everything in my index page to try and to get it to work, I am not getting the Undefined error anymore I am just getting a 0 value with everything I do. The new revised code Model <?php public function countVehicles (){ $this->db->query("SELECT COUNT(id) FROM vehicles WHERE id = :id"); $counter = $this->db->rowCount(); return $counter; } And Controller <?php public function index(){ $counter = $this->vehicleModel->countVehicles(); $data = [ 'counter' => $counter
  7. Hi, thanks for your response I have tried SELECT COUNT, but I still get the same "Undefined index: total" Is there a way I can check if the controller is getting the data?
  8. Hi I will try and explain this as best I can, as I am not sure if the "include" is causing the problem. What I am trying to achieve is count the total number of vehicles in the "vehicles" db table and pass it to views (I have recently moved over to MVC so still learning so please be kind and keep it simple for me please) I have a folder in views called "vehicletracker" , within this folder I have 2 files "index.php" and "widget.php".........The "widget.php" file is an "include" within "index php". The problem I am having is passing data from the controller to the view, I
  9. Hi, I am starting to pick this php business up but I often think if I am doing things right, or if I should treat it as "If it aint broken dont fix it till it is". My login script goes to different directories depending on "role" and I do not know if its the right way of doing things or I am making serious errors with security etc etc My script is <?php if (!empty($_POST['Login'])) { $email = trim($_POST['email']); $password = trim($_POST['password']); if ($email == "") { $login_error = 'Email is required!'; } else if ($password == "") { $
  10. Right Ok, Thank you so much for that I will look into validating the form later and the other parts left me scratching my head, going back to the quote above and #5 The end result is that I have a calendar and in the calendar I want to put events using the "handover" date as the Primary Date 5 days Prior to handover date I would like to put an event in the calendar for "Vehicle Booked for PDI" 2 Days Prior to handover date I would like to put an event in the calendar for "Vehicle Booked for Valet" So you are saying this would be better using queries and not storing the dates in t
  11. Sorry, I am not the worlds best at explaining something I am a novice at but I will try and explain it a little better "The Format is yyyy-mm-dd" I used the same format on the datepicker that Barand gave me of Y-m-d to try and help me and I changed it here(in red) jQuery(function($) { $('.date-picker').datepicker({ startDate: '+10d', format: 'yyyy-mm-dd', autoclose: true, }) //show datepicker when clicking on the icon .next().on(ace.click_event, function(){ $(this).prev().focus(); }); But it gave me a bad output so changed it to yyyy-mm-dd so I could
  12. Sorry I have stripped everything back out, so I can get the DB to accept the form data again as I kept getting errors hoverdate = handover now sorry should of been clearer And yes I do suffer from divititus
  13. Right OK this is the full code with forms etc etc The date format I am using is yyyy-dd-mm I have to use this else Bootstraps Date picker fails and doesnt insert date into DB First the complete form <?php include "includes/header.php"; include "includes/sidebar.php"; $addnew_error_message = ''; $addnew_added_message = ''; if (!empty($_POST['btnAddNew'])) { if ($_POST['reg'] == "") { $addnew_error_message = 'Registration is required!'; } else if ($_POST['chassis'] == "") { $addnew_error_message = 'Chassis No is required!'; } else if ($_POST['handover'] ==
  14. No I am totally lost now, wherever I put the code Barand showed me either gives me an error or the form data does not populate the DB
  15. The form is all working and adding to the database, or should I say it was before I tried doing this I just put an example dummy form up ) so there wasn't a mass of unneeded html
  • 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.