Skip to content

Instantly share code, notes, and snippets.

@selfsame
Created May 6, 2014 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selfsame/bc1b0beb91fbd2548f85 to your computer and use it in GitHub Desktop.
Save selfsame/bc1b0beb91fbd2548f85 to your computer and use it in GitHub Desktop.
<?php
$con = new Connection();
$res = $con->query('SELECT word, hash FROM `keywords` LIMIT 0, 30 ');
$rows = array();
while($r = $res->fetch_assoc()) {
echo $r["word"]." ".$r["hash"]."<br>";
}
$kw = "octopus";
$hash = md5($kw);
$res = $con->query("INSERT INTO `keywords` (`word`, `hash`) VALUES (\'".$kw."\', \'".$hash."\');" );
echo $kw;
echo $hash;
print_r($res);
$con->close();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment