HELP ME PLEASE!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bassphreek
Forum Newbie
Posts: 4
Joined: Fri Apr 02, 2004 12:40 pm

HELP ME PLEASE!!!!

Post by bassphreek »

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.";

}

}
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

belongs.leagueID=league.leagueID; <-- missing a "

belongs.leagueID=league.leagueID";
bassphreek
Forum Newbie
Posts: 4
Joined: Fri Apr 02, 2004 12:40 pm

Post by bassphreek »

in the wonderful words of homer.....DOH!
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

bassphreek wrote:in the wonderful words of homer.....DOH!
Funny you said that, the voices of the simpons are going on strike cause they want more money. I think the radio said they get a 6 digit income PER episode.

man people are greedy! :roll:
Post Reply