logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 04-19-2012, 07:19 PM   #1
moviemastersdk
 
Join Date: Dec 2011
Posts: 33
Default PHP - MySQL query output

I am making a signup site for my game servers whitelist

i am useing phpbb on the website itself, and everytime someone signs up for the whitelist, i want the script, to check the phpbb_users mysql table for a match
here's what i made so far, doesn't seem to work, nothing happends

PHP Code:
mysql_connect("localhost""root""yeah_you_wish") or die(mysql_error());
mysql_select_db("phpbb_db") or die(mysql_error());
$ign $_POST["ign"];
$language $_POST["country"];
$day $_POST["day"];
$month $_POST["month"];
$year $_POST["year"];
$foundithow $_POST["foundithow"];
$email $_POST["email"];
$towny $_POST["towny"];
$addinf $_POST["addinf"];
$date_of_birth $day "-" $month "-" $year;

$query mysql_query("SELECT * FROM pending_signups WHERE ign='$ign'");
$forum_reg mysql_query("SELECT username_clean from  phpbb_users where username_clean ='$ign'");


if (
mysql_num_rows($forum_reg) = 0)
{
header("Location: signup_error2.html");
}
elseif (
mysql_num_rows($query) != 0)
{
header("Location: signup_error2.html");
}
else
{
mysql_query("INSERT INTO  pending_signups (ign,language,born,found,email,towny,addinfo) VALUES('$ign','$language','$date_of_birth','$foundithow','$email','$towny','$addinf')   ") ;
header("Location: signupdone.html");

moviemastersdk is offline   Reply With Quote
Old 04-20-2012, 02:30 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

you are saying with this

Code:
if (mysql_num_rows($forum_reg) = 0)
{
header("Location: signup_error2.html");
}
elseif (mysql_num_rows($query) != 0)
{
header("Location: signup_error2.html");
}
if no result or if there is a result redirect to another page. try this
Code:
if (mysql_num_rows($forum_reg) > 0)
{
header("Location: signup_error2.html");
}

else
{
mysql_query("INSERT INTO  pending_signups (ign,language,born,found,email,towny,addinfo) VALUES('$ign','$language','$date_of_birth','$foundithow','$email','$towny','$addinf')   ") ;
header("Location: signupdone.html");
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 04-20-2012, 07:50 AM   #3
moviemastersdk
 
Join Date: Dec 2011
Posts: 33
Default

But now it only checks for the forum_reg, and not the query?
moviemastersdk is offline   Reply With Quote
Old 04-20-2012, 09:16 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

Sorry My mistake I misread it.
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:05 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com