/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Parse Error

I can’t figure this out what so ever, maybe someone here can help:

[B]Parse error[/B]: parse error, unexpected $ in [B]/home2/dtoporg/public_html/search/5.php[/B] on line [B]98[/B]

line 98 is on the bottom

[code=php]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta name=”robots” content=”noindex,nofollow”>
<link rel=”stylesheet” type=”text/css” href=”style.css”>
<title>Finder Vote</title>
</head>
<body>
<?php
$rate = $_GET[“id”];

//connect to the database
mysql_connect(“localhost”,”dtoporg_dtop”,”abc123″); //(host, username, password)

//specify database
mysql_select_db(“dtoporg_search”) or die(“Unable to select database”); //select the database

//Build SQL Query
$query = “SELECT votes,v_rate,id,urltitle,url FROM search WHERE id=$rate”;

$result = mysql_query($query);
if (!$result) {
echo “Could not successfully run query ($sql) from DB: ” . mysql_error();
exit;
}
if (mysql_num_rows($result) == 0) {
echo “No rows found, nothing to print so am exiting”;
exit;
}
if ($row = mysql_fetch_assoc($result)){

$id = $row[“id”];
$rate = $row[“v_rate”];
$votes = $row[“votes”];
$urltitle = $row[“urltitle”];
$url = $row[“url”];

echo ”
<table>
<tr>
<th colspan=”2″>Current Status</th>
</tr>
<tr>
<td>Your Vote:</td><td>5</td>
</tr>
<tr>
<td>Site Title:</td><td>$urltitle</td>
</tr>
<tr>
<td>Site URL:</td><td>$url</td>
</tr>
<tr>
<td>ID Number:</td><td>$id</td>
</tr>
<tr>
<td>Old Vote Status:</td><td>$rate</td>
</tr>”;

$newrate = ($rate + 5) / $votes;

echo ”
<tr>
<td>New Vote Status:</td><td>$newrate</td>
</tr>”;

$votes = $votes++;
$result = mysql_query(“UPDATE search SET votes=’$votes’ v_rate=’$newrate’ WHERE id=$id”);

echo ”
<tr>
<td>Number Of Votes:</td><td>$votes</td>
</tr>”;

if ($newrate <= 1 && $votes >= 5){
$sql = mysql_query(“DELETE FROM search WHERE id=$id”);

echo ”
<tr>
<th colspan=”2″>This entry will now be deleted</th>
<th colspan=”2″>There are more than 100 votes, and it went under 1</th>
</tr>”;

}else if ($newrate >= 1){

echo ”
<tr>
<th colspan=”2″>Thank You For your vote</th>
<th colspan=”2″>Your Vote Has Been Acounted For</th>
</tr>”;

}else{
echo “Sorry, your vote wasn’t submitted<br><br>”;
}
?>
</table>
</body>
</html>[/code]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @The_Little_Guy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...