Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1007015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:33:10+00:00 2026-05-16T08:33:10+00:00

Okay. I have this code on my site: <?php session_start(); include database.php; include bruger.php;

  • 0

Okay. I have this code on my site:

<?php
session_start();
include "database.php";
include "bruger.php";

$bruger = new bruger();
if( $bruger->logget_ind() ){

  $brugernavn = $_SESSION['brugernavn'];
  $bruger_slash = addslashes($brugernavn);

  $hnavnn = mysql_query(" SELECT hnavn FROM bruger WHERE brugernavn = '" . $bruger_slash . "'");
  $hnavn = mysql_fetch_row($hnavnn);
  $hinfoo = mysql_query(" SELECT besked, Afsender FROM $hnavn[0]");
  while ($hinfo = mysql_fetch_array($hinfoo)){

    echo "<form method = post action = $PHP_SELF>\n";
    echo "Ja<input type=radio name=valg1 value=\"ja\"> Nej<input type=radio name=valg value=\"nej\">";
    echo "<input type=submit value=\"Svar\">\n";

    if (isset($_POST["valg1"])){
      $brugernavn = $_SESSION['brugernavn'];
      $bruger_slash = addslashes($brugernavn);
      $frahvem = $hinfo["Afsender"];
      $query = "UPDATE bruger SET `Status` = '$frahvem' WHERE brugernavn = '$bruger_slash'";
      mysql_query($query) or die (mysql_error());

      $query1 = "UPDATE bruger SET `Ansfra` = 'Nej' WHERE hnavn = '$frahvem'";
      mysql_query($query1) or die (mysql_error());

      echo "Du har nu givet dit svar!";
    }
    echo "<br>";
  }
}
else {
  echo "Du er ikke logget ind";
}
?>

I have been trying to find some help in eight days now, therefore I’m desperate 🙂
It looks as if it only runs the first mysql_query, but not the next one.
Hmm..

Some one who can see what the fault(s) is?

(sorry for my bad english 😉 .. )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:33:11+00:00Added an answer on May 16, 2026 at 8:33 am

    There could be anything wrong. There is not quite enough information to see this all the way through the debugging process. However, here are a few things to try:

    1- Implement error handling to see if there is something wrong with the DB connectivity.

    2- Confirm that $bruger_slash actually contains a value.

    3- Try adding back ticks to the $hinfoo query:

    $hinfoo = mysql_query(" SELECT besked, Afsender FROM `$hnavn[0]`");
    

    4- Update the array reference variable $frahvem = $hinfo[“Afsender”]; to use single ticks:

    $frahvem = $hinfo['Afsender'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It looks like you should either use [$loopcounter] or [],… May 16, 2026 at 4:45 pm
  • Editorial Team
    Editorial Team added an answer Your php script never prints just 1 it prints 0… May 16, 2026 at 4:45 pm
  • Editorial Team
    Editorial Team added an answer If you are using XmlSerializer, you can control whether the… May 16, 2026 at 4:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Okay so I have this web site search script and I'm trying to count
Okay so I have two import pieces of code involved in this. This first
okay so i have a log in button on the top of my site
Okay, here is my situation. I have a page, index.php, which is the mainsite
Have a look at the menus on this page: http://www.pieterdedecker.be/labs/vspwpg/?page_id=96 They look okay in
Okay, I am using the following code to navigate to a page in my
I am trying to get do this: <?php $good_customer = 0; $q = mysql_query(SELECT
I'm new here. I have been trying to create a video capture app using
I have a form like this: <form id=form_main name=form_main action=/search/ target=iframe001 method=get onSubmit=reset_and_subm();> Enter
Apologies if this is a silly question, and I'm not even sure of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.