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

  • SEARCH
  • Home
  • 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 7644405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:40:50+00:00 2026-05-31T09:40:50+00:00

<?php include_oncescripts/connect.php; $sql = mysql_query(SELECT * FROM Tabletest ORDER BY Points DESC, PP DESC,

  • 0
<?php
include_once"scripts/connect.php";

$sql = mysql_query("SELECT * FROM Tabletest ORDER BY Points DESC, PP DESC, Name ASC");

$pos=1;
  while($pos <= 16){
  $row = mysql_fetch_array($sql);
  $Points = $row['Points'];
  $PP = $row['PP'];
  $Name = $row['Name'];

  mysql_query("UPDATE Tabletest SET thiswp=".$pos." WHERE Points=".$Points." PP=".$PP."        Name=".$Name."");
  echo "$pos $Points $Name $PP <br/> \n";
  $pos = $pos + 1;
  }
?>

This echoes out as I would expect i.e.

Position Points  Name PP
1        5       John 55
2        4       Bob  54
3        4       Jane 54
4        3       Rob  50
etc

But it doesn’t update Tabletest – the thiswp field is left blank. Where have I messed up?
Cheers
Rich

  • 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-31T09:40:52+00:00Added an answer on May 31, 2026 at 9:40 am

    You missed out AND.

     mysql_query("UPDATE Tabletest SET thiswp=".$pos." WHERE Points=".$Points." AND PP=".$PP." AND Name='".mysql_real_escape_string($Name)."'");
    

    Edit: Also, just in case Name was a string, it should have had ‘single quotes’ around it and have been escaped, as above. Same goes for anything else that was a string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
My PHP file: <?php include(ConnectDatabase.php); $Username = mysql_real_escape_string($_POST['Username']); $Password = mysql_real_escape_string($_POST['Password']); $q = mysql_query(SELECT
<?php include_once('db.php'); $location = $_POST['location']; $doctor = $_POST['doctor']; $patient_id = $_POST['patient_id']; if(($location != )
php include_once is failing for me with the failed to open stream: No such
While cleaning up some old php scripts I've noticed some weird behavior with require/include
I have two scripts that I call with two PHP include() calls. The first
index.php <?php include_once 'lang.php'; ?> lang.php <?php session_start(); header('Cache-control: private'); // IE 6 FIX
I've three files: index.php /include/conf.php /include/database.php conf.php contains variables to connect to the database.
here is my code for json php include(connect.php); $id = $_GET['lid']; function countRec($fname,$tname) {
<?php include('includes/config.php'); $topi = $_GET['id']; //id of url mysql_select_db(ban, $con); $query = SELECT *

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.