Jump to content

lmcgr44

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by lmcgr44

  1. yes i do know how to insert statements this is mine mysql_select_db("lachlanmcgrath", $con); $sql="INSERT INTO tracker (Date, Time, Amonia, Nitrite, Nitrate, PH, Salinity, Tempreture) VALUES ('$_POST[Date]','$_POST[Time]','$_POST[Amonia]','$_POST[Nitrite]','$_POST[Nitrate]','$_POST[PH]','$_POST[salinity]','$_POST[Tempreture]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?> I'm trying to get at, with the insert what would i put into there for it to insert the logged in user_id
  2. I'll assume you mean "data" not "sql"? I'll assume you ,mean "...user_id field in the table"? I get the feeling you don't know very much SQL (Structured Query Language)? If you wrote the SQL to insert a new record you can add an additional column and value... ok sorry, I'm having trouble wording things because i am new, ill try again, how do i submit the logged in user_id along with the form into the database
  3. ok so thats retrieving the sql? so when I'm adding it to the sql, what would i put into the script to add the user_id to the user_id field in the sql?
  4. That doesn't make sense. You should register a user and they will have perhaps the basic details (Username, Email, Password). They login and are taken to a personalised page where they can enter additional information (E.g. information for their profile). This information is then stored in the database in the same table as their username, email and password using an UPDATE T-SQL statement... I'm not trying to be rude I'm trying to help but no-one can help you if they don't understand your logic... ok i will explain it better, what I'm trying to do really has nothing to do with the login script, only the username they use to login with, or the user_id. so once they are logged in there will be a form for them to add data into about there fish tank (this is an aquarium site) once submitted it goes to the mysql and stores into there, when the person goes to the My Records page it will display all the records that has been added to the database, but the thing i want is with that table, i want it to only show what that user has added to the database not what others users have added is that better? it is hard to explain when you don't know what it is called
  5. ok i have already got my login script set up, i have the add form to database already set up, i also have a table set up retrieving the data from the database, the only thing i can't work out how to do is the add data into the database that is specific to a user and then retrieve that data for that user when he logged in, so know else can view other peoples data, the whole point of me being on here is for help, and that is the point of this forum. am i rite?
  6. I'm sorry like i said I'm new to this, i still do not understand what u mean by that?
  7. yes I'm pretty sure i know what you mean, at the top of my pages i have if (isset($_SESSION['user_id'])) is that what you mean? if so how do i submit the user_id to the database with the form that is being submitted?
  8. ok then how can i accomplish that? can you show me somewhere on the internet that can explain and show me how? thank-you
  9. hey everyone! in new to the whole php and mysql thing and i am stuck with one part, i have got a login script, once loged in it takes them to there account page, on there account page they can added data into there file, to mysql, so what I'm looking for is how to add the username they logged in with to be added into the database with the rest of the information they just submitted, so when they go to retrieve there information into a table they will only get the information that has there username with it. as much help as possible would be great! thank-you
×
×
  • 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.