Jump to content

[SOLVED] Can someone fix this code please?


adamjones

Recommended Posts

Hi.

 

I have this code;

 

<?php
mysql_connect("localhost", "designby_x", "password") or die(mysql_error());
mysql_select_db("designby_x") or die(mysql_error());

$result = mysql_query("SELECT * FROM members") or die(mysql_error());  

while($row = mysql_fetch_assoc($result)) {
if($row['frozen'] == 'yes' WHERE ($row['username'] == '$myusername' {
   header('location:frozen.php');
}
}

?>

 

And I get this error;

 

Parse error: syntax error, unexpected T_STRING in /home/designby/public_html/clients/home.php on line 14

 

Link to comment
https://forums.phpfreaks.com/topic/134557-solved-can-someone-fix-this-code-please/
Share on other sites

<?php
mysql_connect("localhost", "designby_x", "password") or die(mysql_error());
mysql_select_db("designby_x") or die(mysql_error());

$result = mysql_query("SELECT frozen FROM members WHERE username = '$myusername' AND frozen = 'yes'") or die(mysql_error());  

if (mysql_num_rows($result) > 0) {
   header('location:frozen.php');
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.