Jump to content

gawdz

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gawdz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This displays the error if(isset($error)){ echo $error; } This can be called in a different php file and will display an error if given one. if(isset($_POST['stuff'])){ $text = $_POST[text]; if($text != null){ $error = $text; } else { $error = "error: text is null"; } }
  2. Let me give you some insight im doing this to look for compatibility between users. This is where i gather all the "ratings" the logged in user did. $myself = "SELECT storyId,username FROM ratings WHERE username<>'Anonymous' AND username='".$session->username."'"; $result = mysql_query($myself); while ($row = mysql_fetch_array($result)) { $ratings[] = $row['storyId']; } Now im going to go through all the users and see how many times they did the exact same thing my logged in user did. $sql = "SELECT username FROM users"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { foreach ($ratings as $value) { $compat = "SELECT id,username FROM ratings WHERE id='".$value."' AND username<>'Anonymous' AND username<>'".$session->username."' AND username='".$row['username']."'"; $result2 = mysql_query($compat); while ($row2 = mysql_fetch_array($result2)) { $compatibles[] = $row2['username']; } } } But the thing is it times out because i poorly made the query but im not sure how to improve it.
×
×
  • 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.