html - Is it possible to have a php script read from column A and write the string in column B,C,E,etc in the same table -


i'm trying plan ahead since i'm super new php.

i plan on doing script takes votes multiple people, stores in database, php script calculates average, , writes in table. item specific meaning each (a) column row different 1 below.

this plan:

   // create connection     $conn = new mysqli($servername, $username, $password, $dbname);     // check connection     if ($conn->connect_error) {         die("connection failed: " . $conn->connect_error);     }       $sql = "select db (a); 

the last part stuck. want have menu ( scroball type of thing ) user can select name column a. know how make table/echo out of input.

i've found this:

<form action ="register.php" name="myform" method = "post">     <select name="gender" id="gender">             <option value="">select one</option>             <option value = "m">male</option>             <option value = "f">female</option>     </select> </form>  $sql = "insert yourtable (gender) values ('$gender')";  mysql_real_escape_string($sql); $result = mysql_query($sql) or die (mysql_error()); 

from i'm seeing, script doesn't make new row answer everytime new 1 comes in. stores in front of original column since can have 1 answer.


if first part success then, when user inputs number column b in form, mysql this

$sql2 = "insert db (b) values ('taken form b')"; 

and php script rest calculating average , outputting.


** know can insert directly mysql can repeated multiple times same item?**

is possible?

thanks might offer !

i think confused, @ least confused reading question. php(with mysql) server side language , not respond done in browser unless send data server.

php (server side) executes on server should done , sends result computer. result html etc.

so if selects 'female' should send file on server first before can saved in mysql.

the rest of course possible.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -