Click here to Skip to main content
15,889,176 members
Home / Discussions / Web Development
   

Web Development

 
QuestionAccess Denied issue for Web service Pin
Prasanth P27-Mar-16 0:07
Prasanth P27-Mar-16 0:07 
AnswerRe: Access Denied issue for Web service Pin
Afzaal Ahmad Zeeshan28-Mar-16 9:48
professionalAfzaal Ahmad Zeeshan28-Mar-16 9:48 
QuestionHow to sync database offline and online application Pin
Arvind Zamakia25-Mar-16 22:17
Arvind Zamakia25-Mar-16 22:17 
AnswerRe: How to sync database offline and online application Pin
ZurdoDev28-Mar-16 8:37
professionalZurdoDev28-Mar-16 8:37 
AnswerRe: How to sync database offline and online application Pin
Afzaal Ahmad Zeeshan28-Mar-16 9:50
professionalAfzaal Ahmad Zeeshan28-Mar-16 9:50 
QuestionUnitOfWork And Repository Patterns Not Needed When Using EF Pin
MadDashCoder24-Mar-16 8:34
MadDashCoder24-Mar-16 8:34 
AnswerRe: UnitOfWork And Repository Patterns Not Needed When Using EF Pin
Richard Deeming24-Mar-16 9:13
mveRichard Deeming24-Mar-16 9:13 
QuestionSOMEONE HELP ME FIX THIS. URGENT! Pin
EdzMedallada21-Mar-16 8:33
EdzMedallada21-Mar-16 8:33 
i got the eroor

C#
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\test1\register.php on line 54


Heres my code:

C#
<?php
session_start();
if(isset($_SESSION['tbl_info'])!="")
{
	header("Location: home.php");
}
include_once 'dbconnect.php';

if(isset($_POST['btn-signup']))
{
	$username = mysql_real_escape_string($_POST['username']);
	$email = mysql_real_escape_string($_POST['email']);
	$password = md5(mysql_real_escape_string($_POST['pass']));
	$LastName = mysql_real_escape_string($_POST['LastName']);
	$FirstName = mysql_real_escape_string($_POST['FirstName']);
	$MidName = mysql_real_escape_string($_POST['MidName']);
	$Age = mysql_real_escape_string($_POST['Age']);
	$Bdate = mysql_real_escape_string($_POST['Bdate']);
	$Address = mysql_real_escape_string($_POST['Address']);
	$Contact = mysql_real_escape_string($_POST['Contact']);
	$FathersName = mysql_real_escape_string($_POST['FathersName']);
	$FOccupation = mysql_real_escape_string($_POST['FOccupation']);
	$MothersName = mysql_real_escape_string($_POST['MothersName']);
	$MOccupation = mysql_real_escape_string($_POST['MOccupation']);
	$ElemSchool = mysql_real_escape_string($_POST['ElemSchool']);
	$YearGradElem = mysql_real_escape_string($_POST['YearGradElem']);
	$HighSchool = mysql_real_escape_string($_POST['HighSchool']);
	$YearGradhs = mysql_real_escape_string($_POST['YearGradhs']);
	
	$username = trim($username);
	$email = trim($email);
	$password = trim($password);
	$LastName = trim($LastName);
	$FirstName = trim($FirstName);
	$MidName = trim($MidName);
	$Age = trim($Age);
	$Bdate = trim($Bdate);
	$Address = trim($Address);
	$Contact = trim($Contact);
	$FathersName = trim($password);
	$FOccupation = trim($password);
	$MothersName = trim($password);
	$MOccupation = trim($password);
	$ElemSchool = trim($password);
	$YearGradElem = trim($password);
	$HighSchool = trim($password);
	$YearGradhs = trim($password);
	
	
	// email exist or not
	$query = "SELECT email FROM tbl_info WHERE email='$email'";
	$result = mysql_query($query);
	
	$count = mysql_num_rows($result); // if email not found then register
	
	if($count == 0){
		
		if(mysql_query("INSERT INTO tbl_info (username,email,password,LastName,FirstName,MidName,Age,Bdate,Address,Contact,FathersName,FOccupation,MothersName,MOccupation,ElemSchool,YearGradElem,HighSchool,YearGradhs) VALUES('$username','$email','$password','$LastName','$FirstName','$MidName','$Age','$Bdate','$Contact','$FathersName','$FOccupation','$MothersName','$MOccupation','$ElemSchool','$YearGradElem','$HighSchool','$YearGradhs)"))
		{
			?>
			<script>alert('successfully registered ');</script>
			<?php
		}
		else
		{
			?>
			<script>alert('error while registering you...');</script>
			<?php
		}		
	}
	else{
			?>
			<script>alert('Sorry Email ID already taken ...');</script>
			<?php
	}
	
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<link rel="stylesheet" href="style.css" type="text/css" />

</head>
<body>
<center>
<div id="login-form">
<form method="post">
<table align="center" width="30%" border="0">
<tr>
<td><input type="text" name="username" placeholder="User Name" required /></td>
</tr>
<tr>
<td><input type="email" name="email" placeholder="Your Email" required /></td>
</tr>
<tr>
<td><input type="password" name="password" placeholder="Your Password" required /></td>
</tr>
<tr>
<td><input type="text" name="LastName" placeholder="Your Last Name" required /></td>
</tr>
<tr>
<td><input type="text" name="FirstName" placeholder="Your First Name" required /></td>
</tr>
<tr>
<td><input type="text" name="MidName" placeholder="Your Middle Name" required /></td>
</tr>
<tr>
<td><input type="text" name="Age" placeholder="How old are you?" required /></td>
</tr>
<tr>
<td><input type="text" name="Bdate" placeholder="Your Birthday" required /></td>
</tr>
<tr>
<td><input type="text" name="Address" placeholder="Where do you live?" required /></td>
</tr>
<tr>
<td><input type="text" name="Contact" placeholder="Your Contact Info" required /></td>
</tr>
<tr>
<td><input type="text" name="FathersName" placeholder="Your Father's name" required /></td>
</tr>
<tr>
<td><input type="text" name="FOccupation" placeholder="Occupation" required /></td>
</tr>
<tr>
<td><input type="text" name="MothersName" placeholder="Your Mother's name" required /></td>
</tr>
<tr>
<td><input type="text" name="MOccupation" placeholder="Occupation" required /></td>
</tr>
<tr>
<td><input type="text" name="ElemSchool" placeholder="Elem School" required /></td>
</tr>
<tr>
<td><input type="text" name="YearGradElem" placeholder="Year Graduated" required /></td>
</tr>
<tr>
<td><input type="text" name="HighSchool" placeholder="HighSchool" required /></td>
</tr>
<tr>
<td><input type="text" name="YearGradhs" placeholder="Year Graduated" required /></td>
</tr>
<tr>
<td><button type="submit" name="btn-signup">Sign Me Up</button></td>
</tr>
<tr>
<td><a href="index.php">Sign In Here</a></td>
</tr>
</table>
</form>
</div>
</center>
</body>
</html>

AnswerRe: SOMEONE HELP ME FIX THIS. URGENT! Pin
Serkan Onat21-Mar-16 11:43
professionalSerkan Onat21-Mar-16 11:43 
QuestionDeselecting An Element When Another Element is Selected Pin
MadDashCoder20-Mar-16 21:19
MadDashCoder20-Mar-16 21:19 
AnswerRe: Deselecting An Element When Another Element is Selected Pin
Richard Deeming21-Mar-16 3:22
mveRichard Deeming21-Mar-16 3:22 
GeneralRe: Deselecting An Element When Another Element is Selected Pin
MadDashCoder21-Mar-16 7:49
MadDashCoder21-Mar-16 7:49 
GeneralRe: Deselecting An Element When Another Element is Selected Pin
Richard Deeming21-Mar-16 9:57
mveRichard Deeming21-Mar-16 9:57 
QuestionCan the Prestashop Layered Navigation Block work in Localhost? Pin
Andre HS19-Mar-16 4:20
Andre HS19-Mar-16 4:20 
QuestionDiscount Coupons/Deals site Pin
Riya k Sharma17-Mar-16 7:54
Riya k Sharma17-Mar-16 7:54 
AnswerRe: Discount Coupons/Deals site Pin
Goyllo11-Apr-16 2:31
Goyllo11-Apr-16 2:31 
Questionweb servirce url consume Pin
caradri15-Mar-16 4:09
caradri15-Mar-16 4:09 
GeneralRe: web servirce url consume Pin
Nathan Minier16-Mar-16 2:20
professionalNathan Minier16-Mar-16 2:20 
GeneralRe: web servirce url consume Pin
caradri16-Mar-16 3:08
caradri16-Mar-16 3:08 
AnswerRe: web servirce url consume Pin
caradri16-Mar-16 22:20
caradri16-Mar-16 22:20 
QuestionHow to group 3 form fields into one using bootstrap 3 Pin
Emad Hassan Khan13-Mar-16 1:14
Emad Hassan Khan13-Mar-16 1:14 
AnswerRe: How to group 3 form fields into one using bootstrap 3 Pin
Emad Hassan Khan13-Mar-16 1:37
Emad Hassan Khan13-Mar-16 1:37 
QuestionSending SMS Task Pin
Member 1238760712-Mar-16 7:02
Member 1238760712-Mar-16 7:02 
AnswerRe: Sending SMS Task Pin
Richard MacCutchan13-Mar-16 0:11
mveRichard MacCutchan13-Mar-16 0:11 
QuestionMvc5 or MVC plugin Architecture Pin
Member 1114105611-Mar-16 0:41
Member 1114105611-Mar-16 0:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.