Jump to content

Recommended Posts

This is the problem I am having I posted in another forum but it doesn't seem like it was active so here is the problem please help thanks in advanced.

 

This code I have is suppose to check the member list in the hub field and assign the new member a login id depending on what their hub is +1 well it works for all the other hubs but when the user selects the KSEA then it assigns it a KPDX hub id please help. This is my code:

 

<?php
$plist = mysql_query("SELECT * FROM `members` WHERE hub='$_POST[hub]' ORDER BY login DESC LIMIT 1") or die(mysql_error());
$plrows = mysql_num_rows($plist);
if ($plrows=="0"){ 
if ($_POST[hub]=="KSEA"){ $login = "1000"; }
if ($_POST[hub]=="KLAX"){ $login = "2000"; }
if ($_POST[hub]=="KPDX"){ $login = "3000"; }
if ($_POST[hub]=="PANC"){ $login = "4000"; }} else {

while($plr = mysql_fetch_array($plist)){ $login = $plr[login]; } $login = $login + 1; }
?>

 

Also this is the part of the form that contains the hub part.

 

     

      <select name="hub">
              <option>- SELECT A HUB -</option>
              <option value="KPDX">Portland</option>
              <option value="KSEA">Seattle</option>
              <option value="KLAX">Los Angeles</option>
              <option value="PANC">Anchorage</option>
            </select>

 

thanks in advanced!

Link to comment
https://forums.phpfreaks.com/topic/153079-solved-not-updating/
Share on other sites

run the query

SELECT login FROM `members` WHERE hub='KSEA' ORDER BY login DESC LIMIT 1

if its 3000+ then

 

review all that hub to find the point it messed up..

SELECT login FROM `members` WHERE hub='KSEA' ORDER BY login DESC

 

if they are all 3000 then just update them with +1000

Link to comment
https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804060
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.