|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Mar 2003
Posts: 574
|
php guys -- database query, help!
On my "add user" page I need a query that will check if the login supplied already exists and if it does I need the user to be redirected to signup.php?name=1.
I am going on 40 something hours of no sleep, and I need to get this done, help is very much appreciated. And needed. Thanks a ton to whoever can help!!
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Jun 2002
Location: Seattle
Posts: 1,062
|
Code:
$DBH = mysql_connect( ... );
mysql_select_db( 'database', $DBH );
$sql = "SELECT username FROM table WHERE username = 'foo'";
$query_result = mysql_query( $sql, $DBH );
if ( mysql_num_rows( $query_result ) hahahaha 1 )
{
header( "Location: http://" . $_SERVER[ 'HTTP_HOST' ] . "/signup.php?name=1" );
}
|
|
|
|
|
|
#3 |
|
Confirmed User
Join Date: Mar 2003
Posts: 574
|
thats almost exactly what i have, but does the same thing. no go.
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
|
|
|
|
#4 |
|
Confirmed User
Join Date: Mar 2003
Posts: 574
|
it just goes through the rest of the actions as if the header redirect doesn't fucking exist.
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
|
|
|
|
#5 | |
|
Confirmed User
Join Date: Jun 2002
Location: Seattle
Posts: 1,062
|
Quote:
Code:
exit(); |
|
|
|
|
|
|
#6 |
|
Confirmed User
Join Date: Jun 2002
Posts: 871
|
$DBH = mysql_connect( ... );
mysql_select_db( 'database', $DBH ); $sql = "SELECT username FROM table WHERE username = 'foo'"; $query_result = mysql_query( $sql, $DBH ); if ( mysql_num_rows( $query_result ) hahahaha 1 ) { header( "Location: http://" . $_SERVER[ 'HTTP_HOST' ] . "/signup.php?name=1" ); exit(); } |
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Mar 2003
Posts: 574
|
I have no idea why I didn't exit my code, I write beautiful code, must be time to catch up on that sleep. Thanks a ton guys, you're fucking great.
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
|
|