Select string from MySQL db
| From: | PHP List | Date: | Mon, 02 Oct 2000 00:30:46 +0000 |
| Subject: | Select string from MySQL db | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18233@lists.php.net to get a copy of this message | ||
I am trying to match a text string from a MySQL table to pull information.
Is there a way to do this?
Here is my code:
$sql = "SELECT *
FROM weeklyLineups
WHERE week=$week
AND ownerID=$ownerID
AND playerName=$playerName
";
$sql_result = mysql_query($sql,$connection) or die (" Couldn't execute
query.");
while ($row = mysql_fetch_array($sql_result)) {
$weeklyID= $row["weeklyID"];
echo "
$weeklyID<br>
";
}
$week and $ownerID are numbers. $playerName is a text string like - John
Doe. I receive the error "Couldn't execute query". It must be the string
that is messing things up.
I am a newbie and would love some help trying to get this figured out. I
have been playing with it for over a week.
Thanks,
Scott