Jump to content

Virtual-Instructor

Member
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Virtual-Instructor

  1. I want to publicly thank Ben and Randy for all of their help so far. You guys have been invaluable, and I don't believe that I would understand this stuff as well as I do without both of your support. Thank you. Ok so I think I'm getting close to making my first form work. I know I'm missing something but I'm not sure what. To make things easy, I have attached two files to this post, one is a snap shot of the table that I am working with, and the second one is the errors that I am getting. Here is my code so far. <?php //Connect to the DBase include('connection-db.php'); //Create the form after the php code, then handle the form with php. ?> <form action="" method="post"> <div> <label for="bvaid">Mentor BVA ID:</label> <input type="text" name="bva" id="bvaid" size="20"><br /> <label for="first">First Name:</label> <input type="text" name="name" id="first" size="20" /><br /> <label for="date">Available Date:</label> <input type="text" name="date" id="date" size="20" /><br /> <label for="start">Start Time:</label> <input type="time" name="start" id="start" size="20" /><br /> <label for="stop">Stop Time:</label> <input type="text" name="stop" id="stop" size="20" /><br /> <input type="submit" name="submit" value="Create Block"> </div> </form> <?php //this is how I handle the form//.. if($_POST['submit']) { $id=$_POST['bva']; $name=$_POST['name']; $date=$_POST['date']; $start=$_POST['start']; $stop=$_POST['stop']; echo "Name: " . $id . "<br />"; echo "First Name: " . $name . "<br />"; echo "Date Available: " . $date . "<br />"; echo "Start Time: " . $start . "<br />"; echo "Stop Time: " . $stop . "<br />"; if ($stmt = $mysqli->prepare("INSERT schedule (mentor_id, mentor_first_name, avail_date, start_time, stop_time) VALUES (?,?,?,?,?)")) { $stmt->bind_param("ssdtt", $id, $name, $date, $start, $stop); $stmt->execute(); $stmt->close(); } } ?> dbase.PDF dbase problem.PDF
  2. OMG! *facepalm* Note to self, don't fat finger the keyboard! Thanks Ben, that was it.
  3. I actually fixed this one almost alone. I realized that I had the wrong set up for the file location. Ah well live and learn. Speaking of learing. I'm really starting to enjoy this. I'm making minor alterations to the code and it still seems to be working. That is up until I tried to add a new record. Now I am stuck! I've been over the code 6 times and I can't figure where I made the wrong turn, but I keep getting the same error. Fatal error: Call to undefined method mysqli_stmt::bind_pararm() in C:\Program Files (x86)\wamp\www\STC\records.php on line 64 I have a sneaky suspicion that I just set the thing up wrong, (I tend to do that alot) but I can't figure out where. I'm including the code for this one below. The bolded out code is line 64. I know that it has something to do with my parameters, but I'm not sure what. <?php include("db-connection.php"); function renderForm($first = '', $last = '', $error = '', $id = '') { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> <?php if ($id != ''){echo "Edit Record"; } else {echo "New Record"; } ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <h1><?php if ($id != ''){echo "Edit Record"; } else {echo "New Record"; } ?></h1> <?php if ($error != '') { echo "<div style='padding:4px; border:1px solid red; color:red'>" .$error . "</div>"; } ?> <form action="" method="post"> <div> <?php if($id != '') { ?> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <p>ID: <?php echo $id; ?></p> <?php }?> <strong>First Name: *</strong> <input type="text" name=first_name value="<?php echo $first; ?>"/><br/> <strong>Last Name: *</strong> <input type="text" name=last_name value="<?php echo $last; ?>"/> <p>* Required</p> <input type="submit" name="submit" value="Submit" /> </div> </form> </body> </html> <?php } if (isset($_GET['id'])) { // Editing existing record renderForm(NULL, NULL, NULL, $_GET['id']); } else { // Create new record if (isset($_POST['submit'])) { $first = htmlentities($_POST['first_name'], ENT_QUOTES); $last = htmlentities ($_POST['last_name'], ENT_QUOTES); if ($first == '' || $last == '') { $error = 'ERROR: Please fill in all required fiedlds!'; renderForm($first, $last, $error); } else { if ($stmt = $mysqli->prepare("INSERT members (first_name, last_name) VALUES (?,?)")) { $stmt->bind_pararm("ss", $first, $last); $stmt->execute(); $stmt->close(); } else { echo "ERROR: Could not prepare SQL statement."; } header("Location: view.php"); } } else { renderForm(); } } $mysqli->close(); ?>
  4. Thanks for all the help everyone, I am finally getting results. So just to update everyone, this is where I am. I am working in Video 2 of the CRUD folder. This one may not be that difficult. So I am working with Dreamweaver and going through the examples in the videos one at a time. I am altering the code just slightly to work with my dbase that I have set up. In the view records video Ben covers how to extract data from the dbase and display it on the page in a table. I almost came out of my skin when it worked and actually returned the records that I called! What I did notice was a message from DW; "Dynamically-related files could not be resolved because the site definition is not correct for this server." My problem is that if the statement is true, then why did the records pop up? Addtionally how do I resolve this issue so that it does not appear? Any insight into this would be helpful.
  5. Very specific question here. I have installed dreamweaver and I am beginning to work with it throught the video series. I beleive that I have all the information that I need plugged into dreamweaver. I entered in the following code into the codes editor just to make sure that everything was working <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>db-connection</title> </head> <?php phpinfo(); ?> <body> </body> </html> When I clicked on the "Live View" button in dreamweaver, it gave the following message. Sorry, we can't find "db-connection.php". We suggest that you check the spelling of the web address or search above So now my question is where have I gone wrong. This works for WAMP using word pad, but for some reason DW won't display it. Not sure why. Now it should be worth mentioning that I had to make some code alterations to my local host files in WAMP in order to get this thing to work to begin with, but I'm not sure if the same thing will apply here. The only thing that I did was adjust my WAMP settings to port 81 instead of 80. Something tells me that this is going to be at the root of my problem but I'm not sure how to go about fixing it. Any suggestions?
  6. Ben, Thanks for the info, that makes alot of sence. I'll send a PM at some point in the next few days.
  7. You know Ben at some point we should try and hook up on Skype. You are a wealth of information. Ok so I took your advice in regards to naming conventions in my dbase and in doing so realized that I could still cut more corners. So today I would like to ask a specific question to which I think I understand what the anwser should be, but I would still like to run it past you to get your input on the topic. Let me address one table and then the other as I think it will help you understand what I am trying to do. I currently have 9 tables in my dbase, and am planning 3 more to help handle the data that will be needed on my site. This question deals with two of them specifically. The first table is the aircraft table (if you are confussed please refer to earlier posts which outline the sites purpose). The aircraft table has the following fields, id, ac_man, ac_model, ac_type, publisher, and role. Two points to note here. First I am thinking of using your idea to deploy a roles table for my members, but after considering the number of superfluous bits of information that I will be using, I was considering creating a single table called disposition to handle them. Things like Mentor vs Student, Stock Aircraft vs Payware Aircraft and a few others that escape me right this second, could all be placed into a single table and I could then simply use the integer value related to that table. The second point here is in the aircraft table, all fields with the exception of id and role are varchar. ID and role are both integers. Just so that you understand the ac_man is the Aircraft Manufacturer, and ac_model refers to the specific aircraft model. For instance; ac_man = Cessna, ac_model = 172. Moving on then..... The second table is the logbook table. As you may have guessed, this table will contain all the records for flights. In this table there are two fields that directly relate to aircraft entries, but only one that is directly related to the aircraft table. So here is where my brain gets just a little fuzzy as I am thinking of the end result. If I have done things correctly I should be able to allow all members to access their logbooks by parsing the dbase for their BVA Id. What I am hoping to do is to return results that contain all of the information regarding their flights including the type of aircraft that they flew. Here is the rub. While working on my naming conventions it occured to me that I can eliminate three of the four fields which were being used to handle Aircraft data and simply go with a single field in which we would enter just the record number for that particular aircraft. Now the specific question. It has occured to me that when the records return, it will only display the number of the record. So how then do I return the concatination string 'Cessna 172' from the aircraft table. My gut is telling me to use either a variable or what we in the industry refer to as a type tag which would look like 'C172'. Of course I tend to believe that this is also going to be a variable as I would be passing one value to a table in order to return another value which would be echoed out. I've watched your CRUD videos three times now and to date this is some of the best information that I have gotten out of this series as of yet. As I watch them I am beginning to see the lines connect in my mind between what I want to do and how to make it happen. Its all beginning to make more and more sense, but I still have a long way to go.
  8. I love my job, but I hate the hours it suck out of me.

  9. I love my job, but I hate the hours it suck out of me.

  10. OMG BEN! Man up to this point I thought that I had seen some intresting stuff, but when I started your videos on CRUD today it completely blew my mind ! This is what I have been looking for. I will say this however you fly through this information so fast I'm going to have to watch these several times before I can wrap my mind around it. Never the less this is still outstanding infromation. Now I need a little help here so that I can keep up with what you are doing and try these examples for myself. As you know I am going to be working with dreamweaver. I have some tutorials on DW that I probably need to get to, but I don't really want to stop what I'm doing at the moment. So what I would like to know at this point is how to use dreamweaver to do what you were doing. In the video you made several files. I'm getting ready to start the fourth. Would creating a new php document in DW do the same thing that you were doing in CODEA (I believe it was). If that is so then how do I veiw the pages without an index, or in this case is the index a mute point. Finally, since I have already started working with my dbase I should be able to replace the "Records" dbase that you call in your video with my "STC" dbase correct? If that is so I would also assume that I should be able to do the same thing with tabels and just substitue what you are typing for your examples with the correct information that I am using for my table; is that not correct? If this works the way that I think it will, then I should for all intents and purposes be able to start laying the foundation for what I am doing within the next few weeks as alot of what I am seeing ties directly in with what I am planning.
  11. I think I understand this. But if that is true, then how do you use php code in a html form and still give it an .html extension? Actually, I was so tired when I wrote this post I didn't realized I was posting the same question twice. You actually anwsered the question for me already.
  12. Greetings to all, time for another specfic question. Two actually. So I am chomping at the bit to get starting on building my site. I will be using Dreamweaver among other programs, but Dreamweaver will be the primary developer that I use to build the site. Question 1: I don't believe that this is something that Steph has covered as yet. When beginning a new project in HTML how do you determine what file type to use. In dreamweaver is has the Create new column. Here are listed options such as HTML, CSS, PHP and the like. One of the things that are confusing me is the use of extensions. For instance, if you are running PHP code somewhere on the page, does it have to have a .php extension or can I still go with .html and simply add the php code to the page code? Question 2: When creating my php code for my site to store in a file for include statements, is this where I should specify PHP and CSS pages?
  13. Ben has anyone ever told you that you are too smart for your age? Thanks for the great information. I am looking forward to it. In my last post I stated that I was going to be going with expressions web. Well as luck would have it something has turned up in my life since then and I am now the proud owner of Dreamweaver. With that in mind I've got the creativity engine running on all cylinders. So you can start expecting more specific questions in relation to both programs.
  14. New question. This one is simple and to the point. I have noticed that there are a large number of variables that are used in these videos. My question is; Can you create a library of Variables in the same way that you do things like menus and other functions that are called on a regular basis? My thinking here is that with a little forethought and planning I should be able to keep this site relatively clean by keeping things that will be used on a regular basis in a single location.
  15. Ben thanks for the great advise. I am considering your suggestions with regards to roles, but I still have to wrap my mind around the point that you are trying to make. If I have understood you correctly, the roles table would contain the specific names of roles such as mentor and student along with a role_id. In the members table I replace the mentor and student booleans with a single role column and update that with the role integer that coresponds to the roles table? Please let me know if I have understood this correctly. I also appriciate you suggestions on naming conventions. After having read through more of the material, this actually makes more sense and I will be doing some update work on the dbase tables within the next 24 hours (after going through somemore of my videos). To anwser your question of where I am with my videos, on the TXT suggested order of viewing list, I am working from file 3 PHP MySQL Basics. When my brain and body finally colapsed last night after 16 hours of study and practice, I was just starting on the Connecting Video pt 3. I expect to have finished this file sometime this afternoon and be moving on to PHP CRUD + Pagenatioin before I expire this evening. In the video series that I have I have seen videos that relate to Login's but I'm not quite there just yet, that I believe is file 5. So there will be more questions to come. I will say this for the videos, they all assume that I am already an HTML programmer, when really I am not. I have some very light experiance with it but have always relighed on my WYSIWYG editor to do that for me. I confess that I would like to learn this informatoin as I am very currious how to make certain things happen. I would also like to learn to write forms from scratch, specifically how to make them appear as sized pop up windows versus opening as an additional tab. But this to me seems to be getting ahead of myself. For the project that I am working on, I am finding that understanding how all this interactivity works first is going to make the html that much easier. With what I am learning and the speed that I am learning it, I doubt that it will be very long until I am ready to start putting entire pages together.
  16. So I'm finally getting into the meat and potato's of these video's. Because I have worked with dbases in the past, I already had an idea of the structure that I wanted to create. So now I am getting into the MySQL videos and beginning the early development work that will become the foundation of my site. I can't articulate how excited I am . As I begin the development process I will posting very heavily with questions regarding specifics. As such the posts will become more detailed. Therefore I welcome any input that you all have, and when I finally get around to launching the site, I sincerly that you will all be among my first visitors. In addition I have made a few decisions that I would like to share with you all. First I have decided to go with Expressions Web as a WISIWYG. I still want to make the transition to Dreamweaver, but the cost is just too high for the suite that I need. Second, I have learned through experiance that the best sites start with a solid plan. Therefore I will be utilizing MS Visio for my layout plans and have got a pretty good start going. This means that any of you that have these programs please let me know and I will share some of these files with you if it will help with understanding. Ok so with the BS out of the way let me get to the two questions that I have for this partiuclar post. The questions are pretty detailed so please bear with me. But before I get into those questions a little information about what I am doing may be helpful, so lets start there. I am a member of a MS Flight Simulator X virtual community. You can learn more about the community by visiting www.bostonvirtualatc.com. Within the community I am the Director of Pilot training. Over the last two years I have struggled to develop the most realistic and informative virtual training program in existance. I firmly believe that what I am doing can and will eventually have long lasting effects and impact on our participants, which is why I am so passionate about it. I don't do this alone. I have a core staff of six other insturctors who help me organize and teach the material. For legality reasons, our instructors as called Mentors. Those who seek the training are classified as students. Both categories are participants or members. This may seem a little useless at the moment but it will become clear as I start asking questions. The way the program works is people send emails to me which I then distribute to the staff for assignment and the Mentors teach the needed material. Currently this is cumbersome and inefficient. I am trying to move everything to the dbase so that the information is for all intents and purposes automated and easily accessable. Keeping all this in mind let me move into my questions for this post. 1. My first question is in relation to MySQL conventions (I believe thats what the nerds call them). So this afternoon I spent several hours getting my main dbase called STC laid out. There are currently 8 tables in the dbase. I developed the tables with the idea of moving information in and out of them to make things easier on my staff and students. Specifically, in MySQL conventions, how does text capitalization effect things? I guess what I am really asking, should I specifically deploy capitalization when working with the tables. For example, should table names be capitalized with the columns (because the proper term escapes me at the moment) in lower case? Or should I use all lower case text when creating data fields. I know that what ever method I use my code will have to exactly duplicate that method when writing my code. So I guess what I really want to know from the expericance pool is which method works best? Capitalized, or lowercase? 2. One of the things that I have taken away from my experiance is that sites can be driven to display specific information based upon a users permissions. As of yet I have not figured these out completely, but I am of the thinking at the moment that this is somehow tied to the dbase, I just haven't quite wrapped my mind around it just yet. With that in mind my second question deals specifically with member categories. As I mentioned, I currently have two levels of participant. Mentors and Students. Obviously the Students will not have a need to access all the tools that Mentors will need. Allow me to illustrate with an example. In the dbase I have a few tables that will help you to understand. The first one is Members. In the members table I have the following fields. BVAID (each member of the community has one and no two are the same), FNAM (first name), LOG (Login), PASS (Password), STD (Standing, more on this in a moment), EML (email address. So named because I read somewhere that this is a reserved word or something in MySQL), SKYPE (Skype ID), RAT (Rating), MENTOR (this is a boolean Yes or No), Student (Also a boolean). The standing table contains data relating to some specific standings such as MENTOR, STUDENT, DISCIPLINE and so forth, it also has a data field for reason. So getting down to brass taxes here, what has occured to me is that perhaps I have organized this improperly somehow. My thinking in this case was to immediately parse the dbase MEMBERS table and check the true/false categories for student and mentor 1 indications and based upon the results display or hide specific fields and informatoin, that is to say control what the user sees. In this case it can only be one or the other. I haven't figured out how to establish this rule just yet, but as I said, I'm just getting my feet wet here. What I want to know is should I have a seperate table that lists out the specific Classificatioins such as mentor, student and the like or should I condense all this information into a single table? I want to be able to quickly run reports of who is a mentor, student and other things that will be important for myself or my staff need to have access to quickly. To be clear, I am trying to establish a relational dbase here. Ok so that does it for this post. I'll let anwsers come in for a day or two before I move on. Please if you are going to respond to this one, please do so using the quick reply. I think this will help to keep things cleaner and all the responces located in the same general area. Thanks in advance to anyone who responds.
  17. Thanks Ben, I was actually having the same thought. I assume that there are going to be more than one function in which I will need to do the testing directly on the server.
  18. I'm still getting over just how much information is contained in these videos. Ok I have two questions for this post. One is simple and the other not so much. First things first. It is possible that I was trying to do a bit of reorganization at a point not to long ago, but I just want to make sure that in the PHP basics folder of videos, there should only be two folders. I would just like someone that is familiar with the series to verify. The reason that I ask is that I have a third folder and I discovered tonight that the third folder contains some duplicate videos that are in the PHP Misc folder. I'm thinking that I attempted to condense this information and make it easier for me to track where I am in my studies; however I was reviewing the txt document that comes with them to see what is next up in the cue and found that the series on functions that I am curently watching is contained in the PHP misc folder. The second question goes back to an earlier post that I had going when I was having trouble getting WAMP installed and running. I was reviewing the mail function in the video tonight and instead of entering stephs email, I added my own. Two things happened, on the code did not deliver the $result that I was looking for, and two, part of the page displayed but the other half of the page returned an error. The gist of what I understand is that the mail function failed due to yet another port issue. I am wondering if there is anything quick and easy that I can do to get this function to work as intended. I am very intrested in the mail function as I think that it is going to be one of the main functions that I deploy with my site. If you need more information on the code that I was running at the time of the error please let me know I will be happy to post the code on the thread.
  19. I'm beginning to get a better understanding of what I am doing here. Now that I am finally on my weekend I will be able to put some proper study time in over the next few days. So just to recap. CSS controls a common layout, html controls the content, and if I have really understood this, PHP can be used to control the, shall we say, interactivity of a site (putting in forms and getting back results). This stuff is very cool. Maybe I should go back to college for multi media and web design. I've got idea's popping up that I can't wait to get started on.
  20. Wait a minute! Am I understanding you correctly here? CSS is what drives the page layout and HTML drives what is on the page. In other words if I want to maintain the same layout accross the entire site, save for a few forms, then I need to utilize CSS?
  21. My thanks to both of you for your responces. You have both given me food for thought, and in the end I believe that I will most likely employ a combination of the responces, but I will cross that road at a later time after I have further explored the available training availalbe on killer sites. I want to take a minute and try to further clarify my question on includes. While I believe that I have understood Ben and have my mind wrapped around the topic, your statement indicates that I haven't sufficently articulated myself; so please let me clarify. When I think of HTML it is typically on a single level, due in large part to my relative inexperiance. When I think of HTML code I think of code that does only one thing....create pages. Until now I never considered that code could simply be written without displaying an entire page. Yet it now occurs to me that I could write code that only contained my navigation menu's. Or more to the point of the project that I am working on, a menu of forms for students and Mentors (if you don't understand what I mean by student and mentor, see my profile, that should explain it). Getting back to attempting to articulate myself; I understand (currently) the hierarchy of web sites in like this. You have the main site, a folder which contains multiple pages of the site with each page being an individual file. However that being said I also understand that you can have sub folders which contain things like images or flash presentations that run on the site. Now with all of that being said, I think what I am trying to clarify in regards to PHP Includes is the storage of those codes. If you understand that if we take something like a menu, then in my mind that is a page (single file) of code. In the video Steph points out that you can store those files in a sub folder of the parent folder of the site. So in the folder that contains all of the individual pages for the site, you could have a folder that contains all of your code libraries for things such as menus or footers or anything else that you want to use repeatedly within the site. You would then use the PHP Includes function to quickly add those items to the web page that you are writing code for. To date I honestly can only mentally see a web site in two dimensions. I believe that I am at the point where the light is beginning to come on when I will be able to see them in that third dimension, so if I pose a question that I have not quite articulated properly then please let me know. I hope this sheds some light on what I am trying to say.
  22. This profile is a bit like facebook, so where and how do I add friends in the community.

  23. This profile is a bit like facebook, so where and how do I add friends in the community.

    1. falkencreative

      falkencreative

      To add a friend, visit their profile page by clicking on their user name. In the top left below their avatar should be a link "Add me as a friend."

  24. I can't believe how much information is here! I don't care who you are if you are new to this be prepared to have your brain melt within the first few hours. Ok so to date I have started 3 different topics in this forum and instead of starting a new one everytime I have a question, I think that this will be the last one that I start and I will post all of my noob questions here. It keeps things cleaner for those who actually manage the forums. So before these question, a little of background is in order so that anyone who anwsers will understand my knowledge base. I started with static web sites about 7 years ago using MS Front Page. It was easy to work with and I had mild success in creating a few mildly successful albeit very static web sites. I never really took a formal course like the one I'm currently engaged in on HTML. I just sort of Gumped my way through it using premade examples and a book of code explinations. I lost all of my resources three years ago in a fire along with everything that I had ever created. I do this to highlight that I'm not a formally trained programmer. I've worked with various projects both personal and professional over the years and picked up a few things here and there, but never anything concrete. So when I ask questions, I'm not trying to be a pain, I'm just trying to make sure that I understand what I'm learning. So after many frustrating hours trying to get past the first few videos, I think I'm making some progress; at the very least I'm learning some very cool things and am already developing idea's on how to deploy some of this stuff on the project that I have in mind. But I digress. I have two questions that I would like to pose. 1. To simplify the process, should I invest the money into a program like Dream Weaver or MS Expressions? If so I would like to hear from anyone that has used either. My thinking here is that as I observe this process taking place I am beginning to realize that I am way out of my league here, and I'm wondering if a WYSIWYG developer may help to soften the blow to the ol' noodle. Sort of let the WYSIWYG take care of the HTML and I'll focus on processing it using PHP. 2. I have now finished all the videos in folders 1 & 2 of the PHP basics series. (I need a break while my brain stops smoking ) I need a little more clerification on PHP Includes to make sure that I understand them. At first it was a little confusing, but when Steph started talking about Top and Side Menu's it started to make a little more sense. I don't know if I'm looking for a more direct explination or just a confrimation here. If I have understood them correctly, Includes allow you to attach pregenerated blocks of code to PHP pages. Where things get fuzzy is in classifying what these inclusions are. Allow me to clarify them by posing a direct question. Using Stephs Top and Side Menus as an example. Is the Inclusions a folder or a page in the projects folder? If it is a page are the child menu's pages as well or are they simply blocks of code. I guess I'm a little confussed on how to structure and classify Inclusions. It sort of makes scense, but I don't quite think that I have a firm grasp on it. On the heels of the Includes, do you have to know and or understand CSS in order to make them work? I know that I must be a royal pain in the back side with all of my questions, but I do appriciate all of the help that I have beend getting.
  25. It Works! . Ok now this very cool. On to the next video.
×
×
  • Create New...