Jump to content


Photo

Result Return


  • Please log in to reply
2 replies to this topic

#1 cdtc

cdtc
  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 01 July 2006 - 10:15 AM

I am looking for a IF statement that
if returns a result i want it to direct to a page. and tehn else if it does not it will direct to a different page.
CDTC (Cool Digital Technology)
www.cdtc.co.uk

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 01 July 2006 - 10:22 AM


if($whatever==$whatever) {

header("location whatever.php");

}elseif($whatever==$whatever) {

header("location whatever.php");

}else{

header("location whatever.php");
}
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 July 2006 - 10:22 AM

By result you mean a mysql query if so you do something like this:
<?php

// connect to db

$query = "SELECT * FROM table_name WHERE condition=some_value")
$result = mysql_query($query);

if(mysql_num_rows($result) < '1')
{
    // the query returned no results
    header("Location: no-results.php");
}
else
{
    // the query return at least 1 or more results
    header("Location: results.php");
}

?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users