A
Anonymous
Guest
hi guys... here am i again..
hope you could help me on this..
i have a database named jd, and it contains 3 tables.. Member, Topics and Postings... now in my registration.php page, as soon as i click the "register me" button it will direct to saveregistration.php page.. the problem is it returns an error saying "No Database Selected".. to really understand what am i talking heres a snippet...
Here's the code for saveregistration.php
heres for config.php
hep me get this.. please...
hope you could help me on this..
i have a database named jd, and it contains 3 tables.. Member, Topics and Postings... now in my registration.php page, as soon as i click the "register me" button it will direct to saveregistration.php page.. the problem is it returns an error saying "No Database Selected".. to really understand what am i talking heres a snippet...
Code:
<?
include('config.php');
?>
<form action="saveregistration.php" method="post">
<td width="450" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="mainborder">
<tr>
<td width="8" height="14"> </td>
<td colspan="8" valign="top" bgcolor="#9999FF"><div align="center">Please Fill the registration form below.. </div></td>
</tr>
<tr>
<td height="14"></td>
<td width="5"></td>
<td width="80"></td>
<td colspan="5" valign="top"> </td>
<td width="15"></td>
</tr>
<tr>
<td height="22"></td>
<td> </td>
<td valign="middle"><div align="center">Last Name</div></td>
<td colspan="5" valign="top"><input type="text" name="lname" id="lname" size="50"></td>
<td> </td>
</tr>
<tr>
<td height="2"></td>
<td></td>
<td></td>
<td width="29"></td>
<td width="57"></td>
<td width="122"></td>
<td width="29"></td>
<td width="91"></td>
<td></td>
</tr>
<tr>
<td height="23"></td>
<td></td>
<td valign="middle"><div align="center">First Name </div></td>
<td colspan="5" valign="top"><input type="text" name="fname" id="fname" size="50"></td>
<td></td>
</tr>
<tr>
<td height="1"></td>
</tr>
<tr>
<td height="22"></td>
<td></td>
<td valign="middle"><div align="center">E-mail Address </div></td>
<td colspan="5" valign="top"><input type="text" name="email" id="email" size="50"></td>
<td></td>
</tr>
<tr>
<td height="2"></td>
</tr>
<tr>
<td height="22" colspan="3" valign="middle"><div align="center">Password </div></td>
<td colspan="3" valign="top"><input type="password" name="pass" id="pass" size="30"></td>
<td> </td>
<td> </td>
<td></td>
</tr>
<tr>
<td colspan="3" rowspan="3" valign="middle"><div align="center">Re-type Password </div></td>
<td height="1"></td>
</tr>
<tr>
<td height="24" colspan="3" valign="top"><input type="password" name="rpass" id="rpass" size="30"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="1"></td>
</tr>
<tr>
<td height="17"></td>
</tr>
<tr>
<td height="14"></td>
<td></td>
<td></td>
<td valign="top"><input type="checkbox" name="checkbox" value="checkbox"></td>
<td colspan="3" valign="top">I agree to the Policies of this Site. </td>
<td></td>
<td></td>
</tr>
<tr>
<td height="14"></td>
</tr>
<tr>
<td height="26"></td>
<td></td>
<td></td>
<td colspan="2" valign="top" class="buttonFormat"><input type="submit" name="Submit" value="Register Me"></td>
<td> </td>
<td></td>
<td></td>
<td></td>
</tr>
<?
$result=mysql_query("Select * from Topics")or die (mysql_error());
while($row=mysql_fetch_array($result))
{
?>
<? } ?>
</form>
Here's the code for saveregistration.php
Code:
<?
include('config.php');
$lname=$_POST[lname];
$fname=$_POST[fname];
$email=$_POST[email];
$pass=$_POST[pass];
$rpass=$_POST[rpass];
mysql_query("Insert into Member(lname,fname,email,password,rpass)values('$lname','$fname','$email','$pass','$rpass')") or die(mysql_error());
header("location:index.php");
?>
heres for config.php
Code:
<?
$con=mysql_connect('127.0.0.1'.'','');
$db=mysql_select_db("jd");
?>