ITNerd1001 Posted March 8, 2014 Share Posted March 8, 2014 (edited) I am trying to get data from mysql database which is already created. I am trying to get the person to input the information and then have have the PHP code go out and get the correct data back from the database and display it on the screen in a table. This is my connection string to my database. $con=mysqli_connect ("localhost", "root", "", "abc") ; $result = mysqli_query($con,"SELECT * FROM Customer"); This is what I have for my form so far. <form id="Form1" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Customer First Name: <input name="Username" type="text"><br> Customer Last Name: <input name="LastName" type="text"><br> OR<br> Device Name: <input name="DevName" type="text"><br> <input type="submit" value="Submit"> What is the total number of devices that were checked out during a certain timeframe? This is the information that I am trying to pull from my database. I know this isn't much but I am a complete noob at PHP and need help! Thank you very much! Edited March 8, 2014 by ITNerd1001 Quote Link to comment Share on other sites More sharing options...
davidannis Posted March 8, 2014 Share Posted March 8, 2014 What is the total number of devices that were checked out during a certain timeframe? This is the information that I am trying to pull from my database. Do you want the total number checked out by everyone? by a particular user? Where is number of checkouts stored in your database? We need column names. During what timeframe? What database columns have dates? Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 8, 2014 Share Posted March 8, 2014 So - you've written all of two lines of PHP code and now you want us to write the rest? Perhaps you should begin by learning how to write php. Go thru a tutorial or two online and learn instead of starting off by asking others to do your work. Everybody - EVERYBODY - is a complete "noob" at one time. The way to lose that nametag is by learning and it involves some - gasp! - work. Quote Link to comment Share on other sites More sharing options...
ITNerd1001 Posted March 8, 2014 Author Share Posted March 8, 2014 Im not asking you to write my code for me I simply asked for help. This is 1 of 14 queries and I asked for help on just this one. Stop acting like you are the best and stay out of this if you aren't willing to help. I have been going through PHP for like 2 weeks and it is for a school project that is due in 1 week. Just looking for quick help. David- Thanks for acting civil and be willing to help. It is hard to read and understand programming and feel having someone help with something I am working on could help me learn easier. I am looking for just the total that are checked out, not by a single person. I want to make it so they can enter in a date range and get the number of devices check out during that data range. I have a table named device that is linked to term agreement which hast he due dates in it. Quote Link to comment Share on other sites More sharing options...
davidannis Posted March 8, 2014 Share Posted March 8, 2014 I think you need the form to have two inputs, start date and end date. Not sure why you have names and models. Then you need SQL something like: SELECT COUNT * from term WHERE date>='$startdate' AND date<='$enddate' Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 9, 2014 Share Posted March 9, 2014 Im not asking you to write my code for me I simply asked for help. This is 1 of 14 queries and I asked for help on just this one. Stop acting like you are the best and stay out of this if you aren't willing to help. I have been going through PHP for like 2 weeks and it is for a school project that is due in 1 week. Just looking for quick help. David- Thanks for acting civil and be willing to help. It is hard to read and understand programming and feel having someone help with something I am working on could help me learn easier. I am looking for just the total that are checked out, not by a single person. I want to make it so they can enter in a date range and get the number of devices check out during that data range. I have a table named device that is linked to term agreement which hast he due dates in it. THIS is a much more informative post than your first. Do you see how much differently you present yourself this time? Your first post (2nd on this site?) showed you in a much more "needy" light. You presented (as I said) two lines of code and some html and asked for help in writing a query that you apparently had not even attempted. Typical newbie post asking forum members to write the code that the poster is too lazy to even attempt. So - do you have something to show now that you have been provided some input from others? Quote Link to comment Share on other sites More sharing options...
ITNerd1001 Posted March 12, 2014 Author Share Posted March 12, 2014 I't not going to post anymore on here if I keep getting harassed by someone who knows EVERYTHING and is better than everyone else. Please grow up and get a life. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.