[SOLVED] how to find the next record

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rayner75
Forum Newbie
Posts: 11
Joined: Sun Feb 20, 2005 4:45 pm

[SOLVED] how to find the next record

Post by rayner75 »

hello i am trying to create a loginaction page for my login table
here is my code

Code: Select all

<?php
require_once('odbc.php');
// Main ----------
session_start();
   // Get the data collected from the user
  $appUsername =$_POST["formUsername"];
  $appPassword =$_POST["formPassword"];
  
  //$conn->NConnect($hostName,$username,$password); 
   // Formulate the query 
  $sql = "SELECT * FROM User WHERE UserName = '$appUsername' 
	         AND  password = '$appPassword' "; 
	//print $sql;
    $query = odbc_exec($odbc, $sql) or die (odbc_errormsg());
	//print $query->recordCount();
	if ($query->recordCount() < 1) 
	{
		$_SESSION["message"] = "Could not connect as $appUsername " ;
	//	print $_SESSION["message"];
        header("Location: staff.php");
    }
	else 
	  {
	     $_SESSION["authenticatedUser"] = $appUsername;
		//rint $_SESSION["authenticatedUser"];
         // Relocate to the logged-in page
        header("Location: simpleQuery.php");
      } 
	  
?>
the part if ($query->recordCount() < 1)
can recordCount() be used with access ODBC??

Regards


feyd | Please review how to post code using

Code: Select all

and

Code: Select all

tags. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
rayner75
Forum Newbie
Posts: 11
Joined: Sun Feb 20, 2005 4:45 pm

Post by rayner75 »

got this problem sorted, thanks anyway
Post Reply