Jump to content

Greenwitch88

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Greenwitch88

  1. How do I create a chat system in MySQL? Do I use $_POST['submit'] but what is the code for the post? And how do I make it 2 players? Am I right if I use <?php $_POST['submit']; <input type="text" name="username"> <textarea name="post"> <input type="submit" value="Send message!"> <?php $post = "SELECT post FROM posts"; How do I perfect this?
  2. There are a few things I need to know. How do I create an admin dashboard for my blog? How do I check whether a user is logged in using SESSION? Although, this is not what I'm going to have in my blog. I'm going to have an admin dashboard, posts and ability to comment using a username without having any account. Anyone wanna help me do this? Sincerely, Elise
  3. I initially wanted to create a game, and I'm still wondering about whether to check if the user is logged in, and apply food to the owner's dog depending on ID. But I will use this knowledge for a blog, as well.
  4. Yes, I do have a connect.php file, including this code: <?php $servername = "localhost"; $username = "root"; $password = "Canopus88!"; $db = "whatever"; // Create connection $conn = mysqli_connect($servername, $username, $password, $db); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } echo "Connected successfully"; ?> The code I just executed I use in kennel.php, I don't know what you mean with check if the query was successful... The feed status is stored in my database in a column called feed whereas the amount is stored there, in a table called dogs
  5. Hi. I'm new to this forum. My name is Elise. I am trying to create a dog game. So, I have a script that changes the dog feed from respectively to +1 or +14 and so on. This is my code: <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $sql = "UPDATE Hundar SET feed++ WHERE user=1"; } ?> <!DOCTYPE html> <html lang="sv"> <head> <title>Canis-Ludwig! &mdash; Hund SIM</title> <meta charset="UTF-8"> </head> <body> <h1><?php echo "Canis-Ludwig";?></h1> <?php echo $feed;?> <input type="submit" value="Mata hunden"><br><br> <hr> <footer><?php echo "Copyright &copy; aloelissan";?></footer> </body> </html> So, I'm trying to apply the dog feed update ONLY to user that is logged in, for say ID #1106. As you also can see I lack knowledge about MySQL because I don't know how to write the feed++ at SET.
×
×
  • 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.