ngreenwood6 Posted July 31, 2008 Share Posted July 31, 2008 Hello all I am a noob to php and am trying to learn. I have created a database that looks like this: Database: nicks Table: users Inside of the table are these values id:auto increment(primary) firstname: varchar lastname: varchar I created a script that inserts this data into my database and it is working properly. However, what I am trying to accomplish now is to get the data from the database and display it. I am trying to let the user search by their last name. Whenever I click submit it just goes to a blank page (get.php). I have attached a zip file with my files in it. If you need anymore info please let me know. Thanks to anyone who is willing to help a total noob. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
NathanLedet Posted July 31, 2008 Share Posted July 31, 2008 Just off the top of my head...I can't test this so lemme know if this helps: In your form, I added a "value" attribute to the input field: <input name="lastname" type="text" id="get_lastname" value="lastname"> in variables.php, change it to: $get_lastname = trim(stripslashes($_POST['lastname'])); I was going to write out a loop that would retrieve the data from the database, but I just realized you're using mysqli, which I am not familiar with...so I'll stop here and let someone else answer... Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted July 31, 2008 Author Share Posted July 31, 2008 I can use mysql if that is better. I was just going through a tutorial and they were using mysqli so i started using it. Please let me know how you would do it Quote Link to comment Share on other sites More sharing options...
NathanLedet Posted July 31, 2008 Share Posted July 31, 2008 I am comfortable with MySQL. But to be honest, I really don't know if I should be trying to get comfortable with MySQLi. I don't know if it's better or worse. If MySQLi is better, than it's probably best that you learn on it. 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.