Posted: Wed Mar 17, 2004 9:45 pm
hmmm..... are you going to maek us guess at what line 9 is??
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
seeing some of the final code your using that is generating the error would possibly be helpful.SilverMist wrote:It says Parse Error, Line 9. Possibly from the quotations?
Code: Select all
<?php
$host = "localhost";
$dbusername = "user";
$password = "pass";
$database = "db";
// Connect to mysql and database
$link = mysql_connect($host, $dbusername, $password)
or die("<P>Could not connect: ".mysql_error()."</P>");
mysql_select_db($database)
or die("<P>Could not select database</P>");
$username = $HTTP_POST_VARS['txtName'];
$password = $HTTP_POST_VARS['txtPassword'];
$query = "SELECT * FROM Members WHERE Name = '".$username."' AND Password = '".$password."'";
$result = mysql_query($query) or die("<P>Query failed: ".mysql_error()."</P>");
// Check to see if user exists
if(mysql_num_rows($result) > 0)
{
// Make cookie for user
if(setcookie("loginname", $username))
{
echo "Welcome";
}
else
{
echo "Error setting cookie.";
}
}
else
{
echo "Failed login.";
}
?>Code: Select all
<?php
$query = "SELECT * FROM Members WHERE Name = '".$username."' AND Password = '".$password."'";
?>spilt up your code?? All you ahve to do is make sure your actually SELECTing fromt he right table.... "Members" change to whatever the real table's name isSilverMist wrote:Wait...then I'd have to split up my code. Would I be able to do that?