Quote:
Originally Posted by bhgchris
Hello!
|
Hiya
that seems to look more like what i want
this is the code i now have
<?php
$sql = "SELECT City FROM Profiles WHERE ID=" . $memberID;
$query = mysql_query( $sql );
$numrows = mysql_num_rows ( $query );
if ( $numrows < 1 )
{
echo "<script language=\"Javascript\">location.href = 'blankprofile.php';</script>\n";
}
else
{ }
?>
what the idea is to do, when a member logs in, it calls this script with ( include ), checks to see if there profile is filled in ( by looking at city field as that is a mandatory field they have to fill in when editing profile ) if profile isn't filled in it then takes them to a page to ask them to fill it in..
if it is filled in then it does nothing.. note the
else { }
however, although this don't return any errors, its not working yet lol
p.s
my field city will have a city in it, this is text.. example.. leicester
in edit
i stuck in there
echo $numrows;
but see its returning number 1 even if the fielt city is blank so that would be why its doing nothing wouldn't it?
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!
Last edited by Sharon_leic; 01-30-2008 at 10:39 AM..
|