Jump to content

Search the Community

Showing results for tags 'mysqli php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Ok i have 2 issues i will start with the harder one first as it is more past my experties and i have spent time troubleshooting and cant get it solved i have 1 player name email address and 2 random numbers(ballots) that im trying to enter into my db after lengthy playing with the code i have 2 sql insert statements which will only grab the last one into the db Method 1 Steps i tried and results created 2nd table for the 2nd insert RESULT Only inserts to 2nd table echo only shows 2nd insert Method 2 name the sql insert to sql and sql1 same table RESULT gives me Warning: mysqli_multi_query() expects exactly 2 parameters, 3 given in but echos correctly ​ Method 3 Name the sql insert to sql and sql1 different table Result gives me same warning and echos correctly Ideally i would like it to go into 2 rows in same table but am ok with having 2 separate table here is the code // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $sql = "INSERT INTO ballot (username, useremail, randomnumber) VALUES ('".$_POST["username2"]."','".$_POST["email"]."','".$_POST["output"]."')"; $sql1 = "INSERT INTO bonus (username, useremail, randomnumber) VALUES ('".$_POST["username3"]."','".$_POST["email"]."','".$_POST["randomnumber3"]."')"; echo $sql ; if (mysqli_multi_query($conn, $sql, $sql1)) ; { echo "New records created successfully"; } mysqli_close($conn); ?>
×
×
  • 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.