I am getting an unexpexted T_STRING error, and i have no i dea why!
the error is coming from line 26....so i havent gotten to test out the rest(its a work in progress). i have tested the query, and that is A-OK.
Here is my code, any help is appreciated.
$connected = mysql_connect("localhost", "stanisla", "stanisla");
if ($connected)
{
echo "connected";
$query = "select owns.userName, owns.franchiseName , league.leagueName FROM
league, owns, belongs
WHERE
owns.userName=$user AND
owns.franchiseName=belongs.franchiseName AND
belongs.leagueID=league.leagueID;
$result = mysql_db_query("stanisla", $query);
if ($result)
{
$howmany = mysql_num_rows($result);
// print out the matches we found
if ($howmany > 0)
{
echo "<p>Found $howmany matches in the database\n";
while ($r = mysql_fetch_array($result))
{
$league = $r["leagueName"];
$fran = $r["franchiseName"];
echo "$league, $fran";
}
}
else
{
echo "<p>Found no matches for $user.<br>\n";
}
// clean up
mysql_free_result($result);
mysql_close($connected);
} else {
echo "<p>SQL query failed.<br>";
echo "Query was: --- $query ---<br>"; }
} else {
echo "Couldn't connect to database.";
}
}
HELP ME PLEASE!!!!
Moderator: General Moderators
-
bassphreek
- Forum Newbie
- Posts: 4
- Joined: Fri Apr 02, 2004 12:40 pm