开发者

PHP MySQL Script Error? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

I have the following PHP code that I can't seem to get working. I have looked over and over again for the error(s), but can't find it/them.

<?php
$actkey = rand() . "\n";
$con = mysql_connect("HOST", "USER", "PASS");
if (!$con)
  {
  die('Unable to connect:  ' . mysql_error());
  }

mysql_select_db("TABLE", $con);

mysql_query("UPDATE members SET Activation = $actkey WHERE username = 'admin'");
mysql_close($con)

$con2 = mysql_connect("HOST" , "USER" , "PASS");
if (!$con2)
  {
  die('Unable to connect:  ' . mysql_error());
  }
mysql_select_db("a1719745_insaneb", $con2);
$query = mysql_query("I开发者_运维问答NSERT INTO Activation (keycode, valid) VALUES ($actkey, 'yes')");
if(!mysql_query($query, $con2)) {
  die('Error:  ' . mysql_error());
}
mysql_close($con2);
echo "Complete";
?>

Any ideas?


There's a missing semicolon after mysql_close($con).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜