Jump to content
Killersites Community

All Activity

This stream auto-updates     

  1. Yesterday
  2. Last week
  3. administrator

    Are all objects data types or only arrays?

    All objects are datatypes. In fact, each OBJECT is it's own datatype. So when you create an object, your are creating a datatype.
  4. administrator

    Difference between IndexOf and index =

    indexOf is a function built into JavaScript that finds the position of a text in a string of text. In your example, index is just a variable.
  5. LSW

    A Trashing PHP Video

    What is a Big Mac? Is that like the Denali Mac we have here? πŸ˜‹ <?start='useless_culture_lesson'> Seriously, our McDonalds does not carry Big Macs, just Denali Macs, as in the Mountain and state park. </end> πŸ˜‚
  6. administrator

    A Trashing PHP Video

    LOL! Yea. PHP is like McDonalds ... people trash it but it is still the biggest! ... Let's be honest, Big Macs are really tasty. Stef
  7. mgreer58

    A Trashing PHP Video

    Oh, I just wanted to paste a link to this, I didn't mean to open this video. Now, I can't figure out how to delete it. I'm posting this, because it's funny. For a video that is supposed to be trashing PHP, I hear about 50% of it, really listing all of the benefits of PHP.
  8. For those of us still using Windows 7 or Office 2013, you should know that End-of-Life for these products is 2020 (Jan. 2020 for Win 7). That means after that date there will no longer be updates and patches released for them. However this month is of course the end of the Fiscal Year, so to re-allocate assets, Windows will be pulling out of support roles in things like forums next month. Help is still available as long as the programs/OS are still live, you will just have to get help from other users in places like forums. Microsoft walks away from Windows 7, Office 2013 support forums https://www.computerworld.com/article/3281044/microsoft-windows/microsoft-walks-away-from-windows-7-office-2013-support-forums.html
  9. Microsoft seems to have learned it's lesson after the slap in the face changes they hit us with a few years back with the new ribbon and all. This time rather than all changes being thrown into one surprise box new office tool, they will be phasing them in through Office 3016 and Office 365. I do not see anything to complain about right off this time, and part of the change will be an "Upcoming Changes Button" so you can see what to expect next. They are doing it much smarter and the changes for the most part seem to have mostly reason and not just change for change's sake. The article discusses the changes, but the video shows them. I am including the YouTube link from the article so you can go straight to it. YouTube: Updates to the Microsoft Office user experience BusinessInsider.com: Microsoft Office is getting a redesign β€” check out the biggest changes in the apps
  10. Biske94

    Hi Nerdz

    Hi everyone! Is this forum active? Lets populate this forum and make it a nice place for nerdz and geeks where we can talk and help each other. :))
  11. Biske94

    Programing term

    Answer: isset() is a function in PHP that will return true if the variable, in this case, $var has been assigned a value. If the variable has been created but nothing assigned, has the value of null or undefined, it will return false. basically, isset($var) says is this variable safe to use or not. Update To explain the differences between a NULL value and an undefined <?php //test 1 is defined, but has a value of null. isset will return false, use causes no error. $test1 = null; var_dump($test1); var_dump(isset($test1)); echo "\n----------\n\n"; //test2 is defined with a string value. isset will return true $test2 = "test"; var_dump($test2); var_dump(isset($test2)); echo "\n----------\n\n"; //test3 is not defined, isset returns false and use causes error. var_dump($test3); var_dump(isset($test3)); Which will output: NULL bool(false) ---------- string(4) "test" bool(true) ---------- Notice: Undefined variable: test3 in /in/Nmk0t on line 17 NULL bool(false) I hope this will help those who asked the same question as I
  12. Difference between these two index? For ( index = 0; index < dogs.length; index + +); and indexOf
  13. Are all objects data types or only array objects?
  14. administrator

    insert multiple checkboxes into database crud script

    Hi, People wont' debug a big chunk of code like that. So you have to narrow it down. That said, remember that HTML form widgets are just text strings to insert ... which you can do with PHP. So for each record you return, you include a new checkbox.
  15. administrator

    Offline access to the course

    That is the StudioWeb quizzing component. So you watch a video and then get quizzed, get instant feedback, ask for hints, get scored. Stef
  16. Earlier
  17. danieldixon

    Looking for Logo Design Expert

    Hi @creepy, I will suggest to TechTIQ Solutions has a Graphic Designer team they have a many year experience in graphic designer fields so you can get more info here check here Branding Services in London Regards, Daniel
  18. danieldixon

    SMM

    Hi @molinamorgan, You must add links in your profile so it will be see everyone using digital channels like as FB, G+, Twitter, Linked In, Pint-rest, using this digital channels & post link and share that channels. and you will get result. HTH! Regards, TechTIQ Solutions,
  19. dljetaroa

    SMM

    Make links in your profile section of every Social Media Channels and share your post with links.
  20. LSW

    Let’s discuss Windows 10

    Above I mention Cortana as a security concern in Windows 10. This is another example: Cortana Software Could Help Anyone Unlock Your Windows 10 Computer
  21. StefanLRM

    Offline access to the course

    Hello Stefan, Thanks for your quick answer. CONCRETELY what do you mean with "the interactive training". I understand the expression but not the WHO this interactive training can concretely take place in "the projects" ... Do you mean "the concret realisation of projects" ? Greetings from Europe. StefanLRM
  22. LSW

    Patch Tuesday Updates (Windows)

    April & May 2018 Patch Tuesdays both pushed out over 30 important security patches out. June 2018 patches include only 11 critical updates, but those 11 are just as important and should be updated immediately. https://thehackernews.com/2018/06/microsoft-june-security-patch.html
  23. For those of you who have never noticed, the second Tuesday of the month is so called "Patch Tuesday" where Microsoft pushes out it's patches and updates. I will be posting notifications here as a reminder when there are important ones released. Remember that one of the base ways to protect yourself from malware and hackers is to keep all your software and Operating System (OS) up to date.
  24. I am using the crud mysqli script and want to be able to insert multiple checkbox values selected to the database table but add the values to one db table column, below is the coding I have but no data is being added <?php /* Allows the user to both create new records and edit existing records */ // creates the new/edit record form // since this form is used multiple times in this file, I have made it a function that is easily reusable function renderForm($customer_name = '', $customer_email = '', $customer_phone = '', $items_booked_in = '', $computer_make = '', $computer_model = '', $technician = '', $status = '', $exrdate = '', $exrtime = '', $exstdate = '', $exstime = '', $deltype = '', $comments = '', $job_cost = '', $part_cost = '', $profit = '', $error = '', $id = '', $send_sms = '', $username = '', $password = '') { ?> <form action="" method="post" class="form-valide"> <div class="form-group row"> <label class="col-lg-4 col-form-label">Items Booked In</label> <div class="col-lg-6"> <label>Laptop<input type="checkbox" class="form-control" name="Items[]" value="Laptop"/></label> &nbsp; <label>Charger<input type="checkbox" class="form-control" name="Items[]" value="Charger"/></label> &nbsp; <label>Laptop Bag<input type="checkbox" class="form-control" name="Items[]" value="Laptop Bag"/></label> </div> </div> </form> <?php } /* EDIT RECORD */ // if the 'id' variable is set in the URL, we know that we need to edit a record if (isset($_GET['id'])) { // if the form's submit button is clicked, we need to process the form if (isset($_POST['submit'])) { // make sure the 'id' in the URL is valid if (is_numeric($_POST['id'])) { // get variables from the URL/form $id = $_POST['id']; $customer_name = htmlentities($_POST['customer_name'], ENT_QUOTES); $customer_email = htmlentities($_POST['customer_email'], ENT_QUOTES); $customer_phone = htmlentities($_POST['customer_phone'], ENT_QUOTES); $items_booked_in = htmlentities($_POST['items_booked_in'], ENT_QUOTES); $computer_make = htmlentities($_POST['computer_make'], ENT_QUOTES); $computer_model = htmlentities($_POST['computer_model'], ENT_QUOTES); $technician = htmlentities($_POST['technician'], ENT_QUOTES); $status = htmlentities($_POST['status'], ENT_QUOTES); $exrdate = htmlentities($_POST['exrdate'], ENT_QUOTES); $exrtime = htmlentities($_POST['exrtime'], ENT_QUOTES); $exstdate = htmlentities($_POST['exstdate'], ENT_QUOTES); $exstime = htmlentities($_POST['exstime'], ENT_QUOTES); $deltype = htmlentities($_POST['deltype'], ENT_QUOTES); $comments = htmlentities($_POST['comments'], ENT_QUOTES); $job_cost = htmlentities($_POST['job_cost'], ENT_QUOTES); $part_cost = htmlentities($_POST['part_cost'], ENT_QUOTES); $profit = htmlentities($_POST['profit'], ENT_QUOTES); // check that firstname and lastname are both not empty if ($customer_name == '' || $customer_phone == '' || $computer_make == '' || $computer_model == '' || $comments == '') { // if they are empty, show an error message and display the form $error = 'ERROR: Please fill in all required fields!'; renderForm($customer_name, $customer_phone, $computer_make, $computer_model, $comments, $error, $id); } else { // if everything is fine, update the record in the database if ($stmt = $mysqli->prepare("UPDATE repairs SET customer_name = ?, customer_email = ?, customer_phone = ?, items_booked_in = ?, computer_make = ?, computer_model = ?, technician = ?, status = ?, exrdate = ?, exrtime = ?, exstdate = ?, exstime = ?, deltype = ?, comments = ?, job_cost = ?, part_cost = ?, profit = ? WHERE id=?")) { $stmt->bind_param("sssssssssssssssssi", $customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, $id); $stmt->execute(); $stmt->close(); } // show an error message if the query has an error else { echo "ERROR: could not prepare SQL statement."; } // redirect the user once the form is updated header("Location: view-all-repairs-tracking.php"); } } // if the 'id' variable is not valid, show an error message else { echo "Error!"; } } // if the form hasn't been submitted yet, get the info from the database and show the form else { // make sure the 'id' value is valid if (is_numeric($_GET['id']) && $_GET['id'] > 0) { // get 'id' from URL $id = $_GET['id']; // get the recod from the database if($stmt = $mysqli->prepare("SELECT id, customer_name, customer_email, customer_phone, items_booked_in, computer_make, computer_model, technician, status, exrdate, exrtime, exstdate, exstime, deltype, comments, job_cost, part_cost, profit, send_sms FROM repairs WHERE id=?")) { $stmt->bind_param("i", $id); $stmt->execute(); $stmt->bind_result($id, $customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, $send_sms); $stmt->fetch(); // show the form renderForm($customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, NULL, $id, $send_sms); $stmt->close(); } // show an error if the query has an error else { echo "Error: could not prepare SQL statement"; } } // if the 'id' value is not valid, redirect the user back to the view.php page else { header("Location: view-all-repairs-tracking.php"); } } } /* NEW RECORD */ // if the 'id' variable is not set in the URL, we must be creating a new record else { // if the form's submit button is clicked, we need to process the form if (isset($_POST['submit'])) { $country_code = '44'; // get the form data $customer_name = htmlentities($_POST['customer_name'], ENT_QUOTES); $customer_email = htmlentities($_POST['customer_email'], ENT_QUOTES); $customer_phone = htmlentities($_POST['customer_phone'], ENT_QUOTES); $items=NULL; foreach($_POST['items_booked_in'] as $k){ $items[]=htmlentities($k, ENT_QUOTES); } $items=implode(',',$items); $computer_make = htmlentities($_POST['computer_make'], ENT_QUOTES); $computer_model = htmlentities($_POST['computer_model'], ENT_QUOTES); $technician = htmlentities($_POST['technician'], ENT_QUOTES); $status = htmlentities($_POST['status'], ENT_QUOTES); $exrdate = htmlentities($_POST['exrdate'], ENT_QUOTES); $exrtime = htmlentities($_POST['exrtime'], ENT_QUOTES); $exstdate = htmlentities($_POST['exstdate'], ENT_QUOTES); $exstime = htmlentities($_POST['exstime'], ENT_QUOTES); $deltype = htmlentities($_POST['deltype'], ENT_QUOTES); $comments = htmlentities($_POST['comments'], ENT_QUOTES); $job_cost = htmlentities($_POST['job_cost'], ENT_QUOTES); $part_cost = htmlentities($_POST['part_cost'], ENT_QUOTES); $profit = htmlentities($_POST['profit'], ENT_QUOTES); $username = htmlentities($_POST['user_name'], ENT_QUOTES); $password = htmlentities($_POST['user_pass'], ENT_QUOTES); // check that firstname and lastname are both not empty if ($customer_name == '' || $computer_make == '' || $computer_model == '' || $comments == '' ) { // if they are empty, show an error message and display the form $error = 'ERROR: Please fill in all required fields!'; renderForm($customer_name, $computer_make, $computer_model, $comments, $username, $password, $error); } else { // insert the new record into the database //hash the password $hashed_password = password_hash($password, PASSWORD_DEFAULT); if ($stmt = $mysqli->prepare("INSERT repairs (customer_name, customer_email, customer_phone, items_booked_in, computer_make, computer_model, technician, status, exrdate, exrtime, exstdate, exstime, deltype, comments, job_cost, part_cost, profit, user_name, user_pass) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { $stmt->bind_param("sssssssssssssssssss", $customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, $username, $password); $stmt->execute(); $repair_id = $mysqli->insert_id; //check for existing user $check_user = $mysqli->prepare("SELECT customer_email,customer_phone from users where customer_email=?"); $check_user->bind_param("s", $customer_email); $check_user->execute(); $check_user->bind_result($customer_email, $customer_phone); if(!$check_user->fetch()){ if ($stmt = $mysqli->prepare("INSERT users (user_name, user_pass, customer_name, customer_email, customer_phone) VALUES (?, ?, ?, ?, ?)")) { $stmt->bind_param("sssss", $username, $hashed_password, $customer_name, $customer_email, $customer_phone); $stmt->execute(); $userid=$stmt->insert_id; $stmt->close(); $stmt = $mysqli->prepare("UPDATE repairs SET userid = $userid WHERE id=$repair_id"); $stmt->execute(); $stmt->close(); } // show an error if the query has an error else { echo "ERROR: Could not prepare SQL statement."; } } if ($stmt = $mysqli->prepare("UPDATE repairs SET send_sms = 1 WHERE id=$repair_id")) { $stmt->execute(); $stmt->close(); } // show an error message if the query has an error else { echo "ERROR: could not prepare SQL statement."; } endif; } // redirec the user header("Location: view-all-repairs-tracking.php"); } } // if the form hasn't been submitted yet, show the form else { renderForm(); } } // close the mysqli connection $mysqli->close(); ?> Thank you in advance
  25. administrator

    For loop code didn't work like in chapter 7, lesson 4

    It is in the above code snippet.
  26. administrator

    Offline access to the course

    StudioWeb (htmlnirvana) is for the foundation training and it is interactive with quizzing. The projects is just the icing on the cake ... if you will. It is just takes you to the next step in certain areas. The biggest value is in the interactive training.
  27. Depends on the company you are working for. Check job listings and see what they are looking for in terms of education.
  28. ianhaney

    Basic PHP System: View, Edit, Add, Delete records with MySQLi

    I need bit of help with this script if possible. I am trying to add multiple checkbox values into one database table column separated by commas but I can't seem to get it adding to the DB, I have added php error reporting on the site but is not showing any errors after clicking the submit button. My coding is below <?php /* Allows the user to both create new records and edit existing records */ // creates the new/edit record form // since this form is used multiple times in this file, I have made it a function that is easily reusable function renderForm($customer_name = '', $customer_email = '', $customer_phone = '', $items_booked_in = '', $computer_make = '', $computer_model = '', $technician = '', $status = '', $exrdate = '', $exrtime = '', $exstdate = '', $exstime = '', $deltype = '', $comments = '', $job_cost = '', $part_cost = '', $profit = '', $error = '', $id = '', $send_sms = '', $username = '', $password = '') { ?> <!-- Page wrapper --> <div class="page-wrapper"> <!-- Bread crumb --> <div class="row page-titles"> <div class="col-md-5 align-self-center"> <h3 class="text-primary">Add/Edit Repair</h3> </div> <div class="col-md-7 align-self-center"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="../dashboard.php">Dashboard</a></li> <li class="breadcrumb-item active">Add/Edit Repair</li> </ol> </div> </div> <!-- End Bread crumb --> <!-- Container fluid --> <div class="container-fluid"> <!-- Start Page Content --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <h1><?php if ($id != '') { echo "Edit Repair"; } else { echo "New Repair"; } ?></h1> <?php if ($error != '') { echo "<div style='padding:4px; border:1px solid red; color:red'>" . $error . "</div>"; } ?> <form action="" method="post" class="form-valide"> <div class="form-group row"> <label class="col-lg-4 col-form-label">Items Booked In</label> <div class="col-lg-6"> <label>Laptop<input type="checkbox" class="form-control" name="items_booked_in[]" value="Laptop"/></label> <label>Charger<input type="checkbox" class="form-control" name="items_booked_in[]" value="Charger"/></label> <label>Laptop Bag<input type="checkbox" class="form-control" name="items_booked_in[]" value="Laptop Bag"/></label> </div> </div> <?php } /* EDIT RECORD */ // if the 'id' variable is set in the URL, we know that we need to edit a record if (isset($_GET['id'])) { // if the form's submit button is clicked, we need to process the form if (isset($_POST['submit'])) { // make sure the 'id' in the URL is valid if (is_numeric($_POST['id'])) { // get variables from the URL/form $id = $_POST['id']; $customer_name = htmlentities($_POST['customer_name'], ENT_QUOTES); $customer_email = htmlentities($_POST['customer_email'], ENT_QUOTES); $customer_phone = htmlentities($_POST['customer_phone'], ENT_QUOTES); $items_booked_in = htmlentities($_POST['items_booked_in'], ENT_QUOTES); $computer_make = htmlentities($_POST['computer_make'], ENT_QUOTES); $computer_model = htmlentities($_POST['computer_model'], ENT_QUOTES); $technician = htmlentities($_POST['technician'], ENT_QUOTES); $status = htmlentities($_POST['status'], ENT_QUOTES); $exrdate = htmlentities($_POST['exrdate'], ENT_QUOTES); $exrtime = htmlentities($_POST['exrtime'], ENT_QUOTES); $exstdate = htmlentities($_POST['exstdate'], ENT_QUOTES); $exstime = htmlentities($_POST['exstime'], ENT_QUOTES); $deltype = htmlentities($_POST['deltype'], ENT_QUOTES); $comments = htmlentities($_POST['comments'], ENT_QUOTES); $job_cost = htmlentities($_POST['job_cost'], ENT_QUOTES); $part_cost = htmlentities($_POST['part_cost'], ENT_QUOTES); $profit = htmlentities($_POST['profit'], ENT_QUOTES); // check that firstname and lastname are both not empty if ($customer_name == '' || $customer_phone == '' || $computer_make == '' || $computer_model == '' || $comments == '') { // if they are empty, show an error message and display the form $error = 'ERROR: Please fill in all required fields!'; renderForm($customer_name, $customer_phone, $computer_make, $computer_model, $comments, $error, $id); } else { // if everything is fine, update the record in the database if ($stmt = $mysqli->prepare("UPDATE repairs SET customer_name = ?, customer_email = ?, customer_phone = ?, items_booked_in = ?, computer_make = ?, computer_model = ?, technician = ?, status = ?, exrdate = ?, exrtime = ?, exstdate = ?, exstime = ?, deltype = ?, comments = ?, job_cost = ?, part_cost = ?, profit = ? WHERE id=?")) { $stmt->bind_param("sssssssssssssssssi", $customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, $id); $stmt->execute(); $stmt->close(); } // show an error message if the query has an error else { echo "ERROR: could not prepare SQL statement."; } // redirect the user once the form is updated header("Location: view-all-repairs-tracking.php"); } } // if the 'id' variable is not valid, show an error message else { echo "Error!"; } } // if the form hasn't been submitted yet, get the info from the database and show the form else { // make sure the 'id' value is valid if (is_numeric($_GET['id']) && $_GET['id'] > 0) { // get 'id' from URL $id = $_GET['id']; // get the recod from the database if($stmt = $mysqli->prepare("SELECT id, customer_name, customer_email, customer_phone, items_booked_in, computer_make, computer_model, technician, status, exrdate, exrtime, exstdate, exstime, deltype, comments, job_cost, part_cost, profit, send_sms FROM repairs WHERE id=?")) { $stmt->bind_param("i", $id); $stmt->execute(); $stmt->bind_result($id, $customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, $send_sms); $stmt->fetch(); // show the form renderForm($customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, NULL, $id, $send_sms); $stmt->close(); } // show an error if the query has an error else { echo "Error: could not prepare SQL statement"; } } // if the 'id' value is not valid, redirect the user back to the view.php page else { header("Location: view-all-repairs-tracking.php"); } } } /* NEW RECORD */ // if the 'id' variable is not set in the URL, we must be creating a new record else { // if the form's submit button is clicked, we need to process the form if (isset($_POST['submit'])) { $country_code = '44'; // get the form data $customer_name = htmlentities($_POST['customer_name'], ENT_QUOTES); $customer_email = htmlentities($_POST['customer_email'], ENT_QUOTES); $customer_phone = htmlentities($_POST['customer_phone'], ENT_QUOTES); $items_booked_in = htmlentities($_POST['items_booked_in'], ENT_QUOTES); $computer_make = htmlentities($_POST['computer_make'], ENT_QUOTES); $computer_model = htmlentities($_POST['computer_model'], ENT_QUOTES); $technician = htmlentities($_POST['technician'], ENT_QUOTES); $status = htmlentities($_POST['status'], ENT_QUOTES); $exrdate = htmlentities($_POST['exrdate'], ENT_QUOTES); $exrtime = htmlentities($_POST['exrtime'], ENT_QUOTES); $exstdate = htmlentities($_POST['exstdate'], ENT_QUOTES); $exstime = htmlentities($_POST['exstime'], ENT_QUOTES); $deltype = htmlentities($_POST['deltype'], ENT_QUOTES); $comments = htmlentities($_POST['comments'], ENT_QUOTES); $job_cost = htmlentities($_POST['job_cost'], ENT_QUOTES); $part_cost = htmlentities($_POST['part_cost'], ENT_QUOTES); $profit = htmlentities($_POST['profit'], ENT_QUOTES); $username = htmlentities($_POST['user_name'], ENT_QUOTES); $password = htmlentities($_POST['user_pass'], ENT_QUOTES); // check that firstname and lastname are both not empty if ($customer_name == '' || $computer_make == '' || $computer_model == '' || $comments == '' ) { // if they are empty, show an error message and display the form $error = 'ERROR: Please fill in all required fields!'; renderForm($customer_name, $computer_make, $computer_model, $comments, $username, $password, $error); } else { // insert the new record into the database //hash the password $hashed_password = password_hash($password, PASSWORD_DEFAULT); if ($stmt = $mysqli->prepare("INSERT repairs (customer_name, customer_email, customer_phone, items_booked_in, computer_make, computer_model, technician, status, exrdate, exrtime, exstdate, exstime, deltype, comments, job_cost, part_cost, profit, user_name, user_pass) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { $stmt->bind_param("sssssssssssssssssss", $customer_name, $customer_email, $customer_phone, $items_booked_in, $computer_make, $computer_model, $technician, $status, $exrdate, $exrtime, $exstdate, $exstime, $deltype, $comments, $job_cost, $part_cost, $profit, $username, $password); $stmt->execute(); $repair_id = $mysqli->insert_id; //check for existing user $check_user = $mysqli->prepare("SELECT customer_email,customer_phone from users where customer_email=?"); $check_user->bind_param("s", $customer_email); $check_user->execute(); $check_user->bind_result($customer_email, $customer_phone); if(!$check_user->fetch()){ if ($stmt = $mysqli->prepare("INSERT users (user_name, user_pass, customer_name, customer_email, customer_phone) VALUES (?, ?, ?, ?, ?)")) { $stmt->bind_param("sssss", $username, $hashed_password, $customer_name, $customer_email, $customer_phone); $stmt->execute(); $userid=$stmt->insert_id; $stmt->close(); $stmt = $mysqli->prepare("UPDATE repairs SET userid = $userid WHERE id=$repair_id"); $stmt->execute(); $stmt->close(); } // show an error if the query has an error else { echo "ERROR: Could not prepare SQL statement."; } } { $stmt->execute(); $stmt->close(); } // show an error message if the query has an error else { echo "ERROR: could not prepare SQL statement."; } endif; } // redirec the user header("Location: view-all-repairs-tracking.php"); } } // if the form hasn't been submitted yet, show the form else { renderForm(); } } // close the mysqli connection $mysqli->close(); ?> Thank you in advance
  1. Load more activity
Γ—