RE: [PHP] php string match problem
| From: | Martin Towell | Date: | Mon, 19 Aug 2002 05:37:15 +0000 |
| Subject: | RE: [PHP] php string match problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-113177@lists.php.net to get a copy of this message | ||
You've got too many closing braces...
if ($temp == $temp2) {
$ierror = "Loginnamnet är redan upptaget!<br>" . $ierror; } <--- Here's
one
} <--- Here's
the other
} else { print "error"; } <--- And a
third one
You only need one of them...
HTH
Martin
-----Original Message-----
From: Pafo [mailto:pafo@pafo.net]
Sent: Monday, August 19, 2002 3:21 PM
To: php-general@lists.php.net
Subject: [PHP] php string match problem
heh,, is it just me or can anyone see whats wrong with this code...
$query = "SELECT * FROM logininfo WHERE loginname = '$LOGINNAME'";
if ($result = mysql_query($query)){
while ($row = mysql_fetch_row($result)){
$temp = $row[8];
$temp2 = $LOGINNAME;
if ($temp == $temp2) { <-------------- this dosent work
$ierror = "Loginnamnet är redan upptaget!<br>" . $ierror; }
}
} else { print "error"; }
mysql_close($db);
i have tried:
if ($row[8] == $LOGINNAME) {
dosent work either, and when i write:
while ($row = mysql_fetch_row($result)){
print $row[8] . "-" . $LOGINNAME;
it shows the exact same information
anyone got any idea?
patrick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php