Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End POST to MySQLi DB using a form

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #202566
    cscodismith
    Participant

    I am looking to have users post in a form and the information that they provide is to be written to the Database that I have setup. I have already created a database and a table inside of that DB and am just looking on how to exactly to get the information that the user submits into the database upon completion. You can view the code that I currently have here. I am unsure how to do this using MySQLi and have been following through the instructions on how to create DB and connect and everything from here but could not find instructions there on how to accomplish what I am looking for.

    Thank you in advance,
    Codi Smith

    #202567
    cscodismith
    Participant

    UPDATE: I now have it so that users content that they submit are correctly being put into the DB’s table.

    #202647
    cscodismith
    Participant

    Yes I have used W3 Schools tutorial to make my DB in PDO – I had dropped the MySQLi mid way doing it and went with PDO and finished it with the prepared statements.

    #202648
    cscodismith
    Participant

    Thank you for the offer, I may take you up on it. You can view my full code here.

    #202667
    Anonymous
    Inactive

    Am I understanding your code correctly that if your value rests in $_POST['teamname'] that PHP will know to get that automatically for :teamname when passed into the execute?

    Yes. The colon may be omitted for the input parameters (ie. the array that is passed into $stmt->execute()).

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.