Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Apr 2016
    Posts
    9
    Member #
    53771

    PHP Insert Query Execution

    I am new to php and am attempting to insert data from a form into a mysql table. I am using the below code but it does not pull the data just NULL. Are my values incorrect?

    $sql = "INSERT INTO default_mgmt (id, first_name, last_name, lda, lda_rolls, deliquency_date, days_deliquent, default_date, cohort_year, multiple_cohort, loans)
    VALUES ('$id','$first_name','$last_name','$lda','$lda_rol ls','@deliquency_date','$days_deliquent','$default _date','$cohort_year','$multiple_cohort','$loans') ";

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    That is not pulling data, that is inserting data into a table.

    And there is more to it than just defining the query, you have to execute it too.

    Show us more of your script.

    Also, see this:
    https://phpdelusions.net/pdo

    You should be using PDO.
    You can use MySQLi (i=improved)
    You cannot or should not use plain MySQL


  4. #3
    Junior Member
    Join Date
    Apr 2016
    Posts
    9
    Member #
    53771
    Thanks for the reply mlseim. I actually figured it out!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:25 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com