Portal Home > Knowledgebase > Articles Database > PHP > MySql Query Help With Form Pls..


PHP > MySql Query Help With Form Pls..




Posted by MyWinsVPS, 06-28-2008, 04:37 PM
I have a signup form that I want to add a invite function to. Meaning I have a table called "invite" with a column name "code" with different numerical entries in the column that are already assigned to each member already. I know how to do the html part of the form calling the "name" entry from the php action file. The problem that I have having is, the php file calling the SELECT code FROM invite to to enter in the invite "text" block on the on the signup form for new users. I dont want new users to sign up unless they have a code that is defined in the invite column which is assigned to an already member. Any help with this I would be deeply grateful.

Posted by Codebird, 06-28-2008, 07:11 PM
don't know if I understood well but from what I understood the table invite should have something like id_member (id of the member that has that particular code) which is a foreign key that links table invite to table members. here is the php code to use if what I understood is fine: $code is the code of that member.

Posted by MyWinsVPS, 06-28-2008, 08:50 PM
Ok I am going to try to explain a little better. What I am wanting to do is turn the sites security function in to a invite function. Security function being one of those "what is 1+1=answer" on the create account form. Basically I am needing help on what to replace in the invite_code.php to make this work for the "answer" in the account.php file. I want it pulled from column 'code' from 'users' instead of a file like it is now. Hope this explains it a little better and thank you for your help. So what I have in the account.php is and in the invite_code.php it originally had This is how the information should now be pulled. I put the code in with the users tables now to make it more simple instead of pulling from two tables. Last edited by MyWinsVPS; 06-28-2008 at 08:54 PM.

Posted by MyWinsVPS, 06-28-2008, 09:02 PM
The question part is defined by this. Not to worried about this, since this will not be used anyway. I can define that in the html part of the website. Just posting this for reference. If you think it would be easier to not use any of this and just make another "text" block on the create account form. Can you please post what I would need to put in the php part of the account file so if the code does not match what is in sql, it will give an error. I have got everything else lines up with the codes showing up in the users control panel and all, this is the part that is just killing me.

Posted by Codebird, 06-29-2008, 05:49 AM
I guess this would be invite_code.php: this would be account.php



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Setup ssh for users (Views: 566)
WebNX is down? (Views: 644)