MySQL Database Php

existing ones.

Name the Baby Computer


Name the new baby


I will be getting a cute little
box to stick on my LAN at home soon. It needs a name.
something.lerdorf.on.ca


Please give me some suggestions or vote for an existing one.


Suggestion:




mysql_pconnect("localhost","","");
if($new_name) {
if(!mysql_db_query("rasmus","insert into names values
('$new_name',0)")) {
print mysql_errno().": ".mysql_error()."
";
}
}
if($vote && $already_voted) {
print "Hey, you voted already! Vote
ignored.

\n";
}
else if($vote) {
if(!mysql_db_query("rasmus","update names set votes=votes+1 where
name='$vote'")) {
print mysql_errno().": ".mysql_error()."
";
}
}
$result=mysql_db_query("rasmus","select sum(votes) as sum from names");
if($result) {
$sum = (int) mysql_result($result,0,"sum");
mysql_free_result($result);
}
$result=mysql_db_query("rasmus","select * from names order by votes DESC");
print "

\n";
while($row=mysql_fetch_row($result)) {
print "";
}
print "\n";
}
print "
VoteSuggestioncolspan=2>Votes
\">";
print $row[0]."
".$row[1]."";
if($sum && (int)$row[1]) {
$per = (int)(100 * $row[1]/$sum);
print " $per %
\n";
mysql_free_result($result);
?>



border=0>
View Source