Jump to content

rec0il

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

About rec0il

  • Rank
    Member
  1. Hello, I'm trying to create a code that can help me and my friend keep track on how much weight we have used in past workouts and update it regularly while at the gym. To visualise what I'm trying to create, here is a link to the design. Click me I'm not very good at php coder nor SQL, so it's pretty difficult for me, but I've tried to create the code for the whole design but I'm stuck and can't figure out how to create the rest, I was hoping someone could help me. What I'm trying to achieve; To have the name of whoever using it at the top. To have the dropdown menu automaticly generated from my database To have it show the current weight on the selected exercise Be able to update the weight fast and easy What I have so far is <?php include ("connect.php"); $sql = "SELECT * FROM `workout` WHERE exercise='dumbell bench press'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "<br> Ali: ". $row["Ali"] . "<br> Emil: ". $row["Emil"] . "<br><br>" ; } } else { echo "0 results"; } function updater($value,$id){ include ("connect.php"); $value=mysqli_real_escape_string($conn,$value); $id=mysqli_real_escape_string($conn,$id); $sql = "UPDATE `workout` SET Ali='{$value}' WHERE exercise='{$id}'"; if ($conn->query($sql) === TRUE) { header("Refresh:0"); } else { echo "Error updating record: " . $conn->error; } $conn->close(); } if (isset($_POST['Ali'])) updater($_POST['Ali'],$_POST['id']) ?> <html> <body> <?php include ("connect.php"); $sql = "SELECT exercise FROM `workout`"; $result = $conn->query($sql); if ($result->num_rows > 0) { $select= '<select name="select">'; // output data of each row while($row = $result->fetch_assoc()) { $select.='<option value="'.$row['exercise'].'">'.$row['exercise'].'</option>'; } } else { echo "rest in peace"; } $select.='</select>'; echo $select; ?> <br><br> <form action="" method="post" style="height:50px;width:50px;"> <input type="hidden" name="id" value="dumbell bench press" /> <input type="text" name="Ali" /><br><br> <input type="submit" /><br/> </form> </body> </html> Where I've created my database like so: http://i1227.photobucket.com/albums/ee433/rec0ill/12312321_zpsbkamhfry.png
  2. Had it in my mind, but would it be possible to make the area of my map tag, highlight on mouseover too? Can't really seem to get it working this way
  3. Hi again PHP Freaks. So I would like to code something similar to the buy menu of Counter-strike: Global offensive in-game module, just in a browser and for a project of mine. I've made the design in photoshop to illustrate better. I just don't know what I should look into to make this kind of menu, I would love if someone could explain me what languages that this would require. (I'm guessing HTML, CSS and jQuery but I am not sure) more specific help like which particular codes would be much appreciated. Here is a picture of what I would like to create. (Also attached) http://i1227.photobucket.com/albums/ee433/rec0ill/CSGOKeyz_zps4195288a.png
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.