Jump to content

[SOLVED] Selecting ID


BigBobby

Recommended Posts

OK, I've ran in to a slight problem, I'm editing a script and I'm trying to make it more user firnedly, in order to do this i'm running through the code and tweaking slight things.

 

At the current moment everything is ran off ID's I ahve set up a username field called alias.  I've been doing fine up to know but I've come to problem in teh invite function.

 

The absic concept of what happens is the person enters the id number in to the form and click enters this then does various checks one of which is checking the users information. But when the data gets minipulated and put ni to a database it gets submitted as the user id, and as I am trying to change the id to alias i will ahve to try a new method.

 

What I prepose to do is to try and make it so the person can enter the alias(username) and then i'm trying to create a query which will get the id of the alias entered.

 

What I ahve at the current moment is:

 

    // CHECK INVITED PLAYER INFO

    $invitedinfo=mysql_query("SELECT alias,email FROM users WHERE id='$inviteid' OR alias='$inviteid'");

    if ( is_numeric($inviteid) ) echo $inviteid = $inviteid;

    if ( (string)(float)$inviteid !== (string)$inviteid) echo $inviteid=mysql_query("SELECT alias,id FROM users not sure what to insert here, need help.

 

inviteid is where the person will enter the alias.

 

If you need me to explain myself better or in a different way please say so.  Other wise all help is appreciated.

 

Thanks

Bobby

Link to comment
https://forums.phpfreaks.com/topic/60661-solved-selecting-id/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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