MySQL Forums
Forum List  »  PHP

Re: Comparing new value with database
Posted by: Rex Park
Date: January 12, 2006 08:09PM

I tried that and get the error "Fatal error: Call to undefined function: () on line 19

<?
$newaccount = $_POST['account'];
$newskill = $_POST['skillid'];
if (!isset($_REQUEST['account'])) {
?>
<form method="post" action="mysqforumchecker.php">
Account: <input name="account" type="text" ><br>
Skill ID: <input name="skillid" type="text" ><br>
<input type="submit">
</form>
<?
}
else {
$dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("database");

$qry = "SELECT COUNT(*) FROM skills WHERE sid='$newskill'";
$res = mysql_query( $qry ) or die( "Could not execute query." );
if ($mysql_result( $res, 0 ) > 0 ) {
echo "match found";
} else {
echo "new skill";
}

mysql_close();
}
?>

Options: ReplyQuote


Subject
Written By
Posted
January 12, 2006 03:28PM
Re: Comparing new value with database
January 12, 2006 08:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.