Jump to content

rotc_rachel

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rotc_rachel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I guess I want all of the data from one database, but using information from two different databases For instance, my activity_db logs the member_id and the publication_id they posted. I want to have a link next to each user's username that states 'View My Publications', which will need to match their username to the username in my activity_db (which assures the search will only retrieve the publications from the logged in user) and then retrieve all the publication_ids from the activity_db (matches member_id to publication_id), that publication_id I want to use to show all of the entries associated with it in the publications_db.
  2. Hello All, Ran into another problem and would appreciate some help! I have two databases, publications_db (pub_id, title, author, yr, journal, num_pages) and activity_db(member_id,pub_id,date). Basically, when a user is logged in, I want to have an option for them to view the publications they have submitted to the publication database. In pseudocode, I want to display * from publications_db where the session_id (currently logged in user) matches the activity_db.member id AND activity_db.pub_id matches publications_db.pub_id Below is the code I was writing although I am sure it is completely off because I am quite new to this stuff! Any help would be greatly appreciated!
  3. Well, for a little update, I tried running the files provided in the ZIP file from the site, and was able to log in successfully. But after just basically copying and pasting the code that worked to my pages, I attempt to log-in, and if it is correct it doesn't execute to the test.php page, instead it just refreshes to the log-in page (index.php) with blank input fields. index.php (contains the log-in form information): login-exec.php: Incorrect log-in successfully directs me to a 'log-in fail' page, but correct log-in just refreshes the page I'm already on?
  4. Hello All, I ran into another issue and am looking for some help! I am currently messing around with the tutorial and files from this link; http://phpsense.com/php/php-login-script.html?commented=0#txpCommentInputForm My database connections are correct and I receive no errors. But, when I try and log in with a u/n and p/w that I know are correct, it automatically directs me to the log-in failed file. I can't seem to figure out why and am thinking it may have something to do with the password encryption or a PHP setting I need to set. Any ideas? Thanks for any help, -Rachel
  5. Would you mind explaining the security risk you described? I'm interested in learning! Also, I switched out my SELECT statement, but it gives me an error on line 73 which is;
  6. Hello everyone, New to PHP and ran into another beginner issue. I've tried google for answers, but no luck with my specific problem. The goal I am going for is I have an database of Publications. The user is allowed to search by 'Author' which is a column name with in the database. So, on an html page I have a short form script that asks the user which Author to search for. The action= field executes to the php file where I use $_POST to store the user entered author into a variable called &author. From here I would like to SELECT * FROM publications WHERE author(column name) = &author. I then want to display the table, so I call a while loop and echo out the table. When I attempt to carry out the entire code, nothing shows. I am wondering if it is my SELECT statement that is incorrect or if my while look is not set up correctly. Below is the PHP code, I would greatly appreciate any help!
  7. I don't believe you need the second 'WHERE' in there
  8. So when you choose a selection, your form executes to a page called google.php. Try storing what they pick in a variable from $_POST and then on the google.php do a SELECT * FROM database WHERE firstname = '$variable' Then just display that? I'm not sure if that is what you were going for, your code makes it a bit more compact. I'm guessing it has something to do with the WHILE loop if it's only showing one char of the string though.
  9. What does your HTML code look like for the form?
  10. Thank you so much both for you help. I had to play around with WAMP and some settings but it is now up and working. I am sorry if my questions were very beginner, just getting started with PHP and do appreciate the help!
  11. Actually I tried running a simple PHP 'echo' script right after the first <?php tag and nothing displayed. I don't think my PHP is working but I don't know how that is possible as I am running on WAMP. :/ EDIT: Figured out the 'just' of it. Now I'm actually able to execute php code, BUT the "Error querying database" is produced.
  12. Also, I manually inserted values from phpMyAdmin, I transferred the PHP it gave me there to my .php file, changed around only the values. Saved it, started at the form's original html page, it brought up the php_report page, and still that did not even add anything to the db. I'm thinking it's some connection problem but I have no idea what it could be.
  13. Yeah, I was looking to add more "constraints" to the database, but wanted to make sure it was generally working beforehand. Well I changed the database name so it is different from the table. I've also changed the YEAR to yr, since I believe YEAR may be a reserved word. Finally, I added your query and ran through the page and still, nothing. I'm starting to think it's not even connecting properly to the database but no errors are showing.
  14. Also, would the HTML form field that uses 'text' matter when a database column attribute is an 'INT' for that variable, or should the whole script work but would just default the INTs to '0'?
  15. localhost -> Database: publications -> Table: publications In my connection variable ($dbc) I changed the database name to publications, since there is no uppercase on the 'p'. I am thinking the database and table being the same name was not a smart idea but technically, would it really affect anything? TO test, I'm running the SQL statement; SELECT * FROM publications When I insert through phpMyAdmin and display the SQL, it shows something like
×
×
  • 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.