I have a report page and an action page. Report page I have a form inside keeps a table with 9 rows, I'll pick up the player names from the current match and fill in the score, number of series for each player, then I press the submit button.
When running the action page, which looks like this in MySQL:
<?php require_once('../Connections/test.php'); ?>
<?php mysql_select_db($database_test, $test);
for($i=1; $i<=9; $i++) {
if ($_POST["spelid$i"]>"0") { /* checks that spelid is greater than 0 */
mysql_query( sprintf(
"INSERT INTO team_snitt (spelid,resultat,serier,banp,matchid) VALUES ('%s','%s','%s','%s','%s')",
mysql_real_escape_string($_POST["spelid$i"]),
mysql_real_escape_string($_POST["resultat$i"]),
mysql_real_escape_string($_POST["serier$i"]),
mysql_real_escape_string($_POST["banp$i"]),
mysql_real_escape_string($_POST["matchid$i"])
));
} }
/* mysql_query("DELETE FROM team_snitt WHERE spelid=0 "); */
header("location:lagra_resultat.php");
?>
How do you make this to MySQLi so it fits with the web assistant files?
I can nothing on MySQLi.