Hi, sorry i need some help… I failed to import php write data file in phpmyadmin data base. see the php code below…
<?php //connecting to the database define('DB_HOST', 'localhost'); define('DB_NAME', 'coict_sites_attendances'); define('DB_USER','mwana'); define('DB_PASSWORD','mwana0123456789'); $con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error()); $db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error()); $RFID_TAG_No = (isset($_GET['RFID_TAG_No']) ? $_GET['RFID_TAG_No'] : null); $SITE_NAME = (isset($_GET['SITE_NAME']) ? $_GET['SITE_NAME'] : null); $sql = "INSERT INTO coict_sites_attendances.guards_daily_routine_table(RFID_TAG_No,SITE_NAME ) VALUES (".$RFID_TAG_No.", ".$SITE_NAME.")"; mysqli_query($sql, $con); mysql_close($con); ?>and see below the error that i get from the code above after importing it,
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘<?php
//connecting to the database
define(‘DB_HOST’, ‘localhost’)’ at line 1