topflight Posted April 7, 2009 Share Posted April 7, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/ Share on other sites More sharing options...
MadTechie Posted April 7, 2009 Share Posted April 7, 2009 Have to check the database as thats the likely problem! Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804051 Share on other sites More sharing options...
topflight Posted April 7, 2009 Author Share Posted April 7, 2009 what should I check for? Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804053 Share on other sites More sharing options...
MadTechie Posted April 7, 2009 Share Posted April 7, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804060 Share on other sites More sharing options...
topflight Posted April 7, 2009 Author Share Posted April 7, 2009 ok I ran the query and I deleted the all the logins with 3000 but the script still doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804067 Share on other sites More sharing options...
MadTechie Posted April 8, 2009 Share Posted April 8, 2009 run the same query again to double check also whats the highest login number that was in the 2000's Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804072 Share on other sites More sharing options...
topflight Posted April 8, 2009 Author Share Posted April 8, 2009 actually I ran the query and I just deleted all the logins numbers with that HUB and just told all the member to re apply and I tested the script and all is good thanks! THANK YOU VERY MUCH! p.s looking at my code why was it doing that? Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804077 Share on other sites More sharing options...
MadTechie Posted April 8, 2009 Share Posted April 8, 2009 Alot of the time the problem is right under your nose.. but sometimes you need to rip up the floorboards to find it However.. what is going to happen after you get 999 memebers on a hub ? Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804083 Share on other sites More sharing options...
topflight Posted April 8, 2009 Author Share Posted April 8, 2009 To be honest I dont know all I did was raned the 1 query and the 2nd query u gave me then I deleted those ones. Next I created a test account and it worked so I said YES!!! lol Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804092 Share on other sites More sharing options...
topflight Posted April 8, 2009 Author Share Posted April 8, 2009 does anybody else know why that happen Quote Link to comment https://forums.phpfreaks.com/topic/153079-solved-not-updating/#findComment-804191 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.