NEWBIE to php
am 24.12.2005 05:11:14 von vncntjI apologize for asking such an easy question but I'm trying to check if
the recordcount is "1". If so, it should redirect the page.
// Connecting, selecting database
$link=mysql_connect ("localhost", "user", "password") or die ('I cannot
connect to the database because: ' . mysql_error());
mysql_select_db ("dbData");
$slogin = trim($HTTP_POST_VARS["tlogin"]);
// Performing SQL query
$query = "SELECT Count(*) FROM tusernames WHERE logins = '$slogin'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
if ($HTTP_POST_VARS["postback"]=="y") {
// Printing results in HTML
echo "
$col_value | \n";
}
// This is where I'm having difficulty....
if ($col_value) == "1" {
header("www.espn.com"); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
}
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>