hello all,
i'm new at this php and mysql stuff,
i need to display the total amount from each field i have, (each field may have different words submitted i.e. pub_priv may contain public or private)
here is my code to submit.
here is my code that displays the resultsPHP Code:<?php
error_reporting(E_ALL ^ E_NOTICE);
$db = mysql_connect("localhost","","");
mysql_select_db ("reforumc_email");
$query = "INSERT INTO equinoxsurvery(pub_priv, size, scope, position, entrepreneur, more_entrep, percieve, attracted, entrep_approach, met, screens, behave, rewarded, offers, function)
VALUES('".$_POST['pub_priv']."','".$_POST['size']."','".$_POST['scope']."','".$_POST['position']."','".$_POST['entrepreneur']."','".$_POST['more_entrep']."','".$_POST['percieve']."','".$_POST['attracted']."','".$_POST['entrep_approach']."','".$_POST['met']."','".$_POST['screens']."','".$_POST['behave']."','".$_POST['rewarded']."','".$_POST['offers']."','".$_POST['function']."')";
$result = mysql_query($query);
echo "Thank you for taking our survey."; ?>
and here are the links to the pages that are submitting them... it's not completely ready. and it's not displaying all the results in the tables, but it's a startPHP Code:<?php
$connection = mysql_connect ("localhost","reforumc_eup","test1234");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
}
$query = "SELECT * FROM equinoxsurvery";
$result = mysql_db_query ("reforumc_email", $query);
if ($result){
echo "<table border=1>";
echo "<tr><td><b>Full Name</b></td><td> <b>Email Address</b></td></tr>";
$numOfRows = mysql_num_rows ($result);
for ($i = 0; $i < $numOfRows; $i++){
$question1 = mysql_result ($result, $i, "pub_priv");
$question2 = mysql_result ($result, $i, "size");
$question3 = mysql_result ($result, $i, "scope");
echo "<table border=1>";
echo "<tr colspan=3><td>$question1</td><td bgcolor=#E8EFF7>$question2</td><td>$question3</td></tr>";
echo "</table>";
}
echo "</table>";
}
else{
echo mysql_errno().": ".mysql_error()."<BR>";
}
mysql_close ();
?>
Please tell me if i've made no sense
test page




Bookmarks