I havnt used php in a long time same with mysql mysqli and pdo are all very new to me and i have a project that is now due tomorrow... ive been trying to get this to work for over a week now and now as the deadline looms im about to throw up my hands and hope theres someone that could help me finish the code. ( i do plan on learning pdo and the new php8, but i do not have that time atm for this project.
I currently only have the html portion made of the form, as well as the db tables / fields. I have also made the results page that would display the inputed fields from the form and that works great "when entering the data manually through 'phpmyadmin' what i am missing is the php to update those fields in the database.
I am using a CMS so its a little different as i dont need to connect to the data base as im already connected.
this is my current code...
<?php
require_once "maincore.php";
require_once "subheader.php";
if (iMEMBER) {
$data = dbarray($result);
$result = dbquery("UPDATE ".$db_prefix."users (user_loyalty, user_cavs, user_foot, user_archer, user_reset, user_6, user_8, user_12, user_16, user_18, user_23")
$loyalty = isset($_POST['user_loyalty']) ? stripinput(trim($_POST['user_loyalty'])) : "";
$cavs = isset($_POST['user_cavs']) ? stripinput(trim($_POST['user_cavs'])) : "";
$foot = isset($_POST['user_foot']) ? stripinput(trim($_POST['user_foot'])) : "";
$archer = isset($_POST['user_archer']) ? stripinput(trim($_POST['user_archer'])) : "";
//availability match check boxes with table
$reset = isset($_POST['user_reset']) ? stripinput(trim($_POST['user_reset'])) : "";
$reset6 = isset($_POST['user_6']) ? stripinput(trim($_POST['user_6'])) : "";
$reset8 = isset($_POST['user_8']) ? stripinput(trim($_POST['user_8'])) : "";
$reset12 = isset($_POST['user_12']) ? stripinput(trim($_POST['user_12'])) : "";
$reset16 = isset($_POST['user_16']) ? stripinput(trim($_POST['user_16'])) : "";
$reset18 = isset($_POST['user_18']) ? stripinput(trim($_POST['user_18'])) : "";
$reset23 = isset($_POST['user_23']) ? stripinput(trim($_POST['user_23'])) : "";
echo "<div class='' align='center'>
<h1>Stats for Eden</h1>
</div>
<form class='' name='test' method='post' action='".FUSION_SELF."' enctype='multipart/form-data''
target='_self'><br>
<div class='' align='center'> <label for='availability' class=''>Select
Available Times<span class='tooltip' tooltip='Check the times your available for battle'>
</span></label>'
<ul id='availability'>
<li><input name='reset' value='yes' type='checkbox'>Reset</li>
<li><input name='6' value='yes' type='checkbox'>+6</li>
<li><input name='8' value='yes' type='checkbox'>+8</li>
<li><input name='12' value='yes' type='checkbox'>+12</li>
<li><input name='16' value='yes' type='checkbox'>+16</li>
<li><input name='18' value='yes' type='checkbox'>+18</li>
<li><input name='23' value='yes' type='checkbox'>+23</li>
</ul>
</div>
<div class='' align='center'><label for='footmen' class=''>Footmen<span class='tooltip-element'
tooltip='highest level footmen'> </span></label>
<select class='form' name='footmen' id='footmen' required='required' aria-required='true'>
<option disabled='null' selected='null'>-</option>
<option value='7' id='footmen'>T7</option>
<option value='8' id='footmen'>T8</option>
<option value='9' id='footmen'>T9</option>
<option value='10' id='footmen'>T10</option>
</select>
<label for='archers' class=''>Archers<span class='tooltip' tooltip='highest level archers'></span>
</label>
<select class='form' name='footmen' id='footmen' required='required' aria-required='true'>
<option disabled='null' selected='null'>-</option>
<option value='7' id='archers'>T7</option>
<option value='8' id='archers'>T8</option>
<option value='9' id='archers'>T9</option>
<option value='10' id='archers'>T10</option>
</select>
<label for='archers' class=''>Calvary <span class='tooltip-element' tooltip='highest level calvary'></span>
</label>
<select class='form' name='calvary' id='calvary' required='required' aria-required='true'>
<option disabled='null' selected='null'>-</option>
<option value='7' id='calvary'>T7</option>
<option value='8' id='calvary'>T8</option>
<option value='9' id='calvary'>T9</option>
<option value='10' id='calvary'>T10</option>
</select>
</div>
<div class='' align='center'><br>
</div>
<div class='' align='center'> <label for='loyalty' class=''>Loyalty Level
<span class='tooltip' tooltip='EDEN Loyalty'>
</span></label>
<input placeholder='0' class='form' name='loyalty' value='0' id='number-loyalty' title='eden loyalty level' required='required' form='stat_update' min='0' max='30000' type='number'> </div>
<div class='' align='center'> <input name='submit' form='test' formaction='submit-form-db' formmethod='post' formtarget='_self' type='submit'>
<input name='reset' type='reset'>
</div> </form>";
} else {
redirect("index.php");
}
require_once "footer.php"
?>