Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4106540
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:23:23+00:00 2026-05-20T21:23:23+00:00

<?php $con = mysql_connect(localhost,,); if (!$con) { die(‘Could not connect: ‘ . mysql_error()); }

  • 0
  <?php
$con = mysql_connect("localhost","","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("", $con);

$sql="INSERT INTO PatientData (username, Date, GlucoseReading, Carbohydrates, InsulinUsed, InsulinType,WhichMeal)
VALUES 

('$_Post[username]', '$_POST[Date]', '$_POST[GlucoseReading]', '$_POST[Carbohydrates]', '$_POST[InsulinUsed]','$_POST[InsulinType]', '$_POST[WhichMeal]' )";


if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";
mysql_close($con);
?> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:23:24+00:00Added an answer on May 20, 2026 at 9:23 pm

    Adding to what the previous posters have said, make sure your date is valid. For example, 2011-02-31 is an invalid date, which MySQL will turn into 0000-00-00.

    Illegal DATETIME, DATE, or TIMESTAMP values are converted to the “zero” value of the appropriate type (‘0000-00-00 00:00:00’ or ‘0000-00-00’). (MySQL documentation)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to retrieve data from mysql database into stylesheet.php but it is not
PHP: $SQL = SELECT goodies FROM stash WHERE secret=' . str_replace(','',$_POST['secret']) . '; Could
PHP, as we all know is very loosely typed. The language does not require
I have a basic ajax application, which will not work, instead the php code
Warning:mysql_fetch_array(): supplied argument is not a valid MySQL result resource in **/home/davzyco1/public_html/notes/functions.php** on line
I have to insert some data into a MySQL table. The data will be
I am running following PHP code to interact with a MS Access database. $odbc_con
PHP has a great function called htmlspecialcharacters() where you pass it a string and
PHP's explode function returns an array of strings split on some provided substring. It
PHP stores its session information on the file system of the host of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.