Hi and Merry Christmas to all
I pretty inexperienced with all coding.
But trying to build a simple form utilising both radio buttons and textfields…
Unfortunately I cant get anything to INSERT into the MYSQL DATABASE table.
When I run the script below I get a message… Array
(
)
Not sure what this message is telling me as I cant seem to locate info it???
[code]
testform [/code] [php]<?php$db_host = “localhost”;
$db_username = //“username”;
$db_pass = //“password”;
$db_name = //“databasename”;
$table = “test”;
@mysql_connect ("$db_host","$db_username","$db_pass") or die (“Check your stuff connection to MYSQL failed probably the db host as localhost is wrong”);
@mysql_select_db("$db_name") or die (“Didnt find that database”);
echo (“you’ve got the connection to this database”);
?>
'; print_r($_POST); if (isset($_POST['rig'], $_POST['medication'])) { $rig = $_POST['rig']; $medication = $_POST['medication']; $sql = ("INSERT INTO tabletest (rig,medication) VALUES ('{$rig}','{$medication}')"); $result = mysql_query($sql) or trigger_error("Query Failed! SQL: {$sql} - Error: ".mysql_error(), E_USER_ERROR); } [/php]