Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
Getting error when everything looks right.
Old 06-16-2010, 07:56 PM Getting error when everything looks right.
Skilled Talker

Posts: 83
Trades: 0
For some reason, the following code is giving this error:
Parse error: syntax error, unexpected '}' in /home/content/s/m/u/smudlys/html/ratestest.php on line 21

This is the line after the first if statement.


MySql version: 5.0.19

Here is my code:
PHP Code:
<?php
/// Include Admin Page Here ///
include('inc/connect.php');

$user $_SESSION['username'];
$getmember mysql_query("SELECT * FROM users WHERE username='$user'");
while (
$row mysql_fetch_assoc($getmember))
{
$member $row['member'];
}
$getlevel mysql_query("SELECT * FROM userstats WHERE username='$user'");
while (
$row mysql_fetch_assoc($getlevel))
{
$level $row['level'];
}

$addrate .005;

if(
$member==0){
    
$rate = ($level*$addrate+.50)
}
if(
$member==1){
    
$rate = ($level*$addrate+1)
}

?>

Last edited by Smudly; 06-16-2010 at 08:02 PM..
Smudly is offline
View Public Profile
 
 
Register now for full access!
Old 06-16-2010, 08:13 PM Re: Getting error when everything looks right.
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You're forgetting two semicolons:
PHP Code:
$rate = ($level*$addrate+.50
and
PHP Code:
$rate = ($level*$addrate+1
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
View Public Profile Visit NullPointer's homepage!
 
Old 06-16-2010, 08:15 PM Re: Getting error when everything looks right.
Skilled Talker

Posts: 83
Trades: 0
Those darn semi colons. Thank you! it works
Smudly is offline
View Public Profile
 
Old 06-22-2010, 01:42 PM Re: Getting error when everything looks right.
Super Talker

Posts: 144
Name: Nick Mallare
Location: Olathe, KS
Trades: 0
Please prepend the title of this post with [RESOLVED].

Nick
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
nmallare is offline
View Public Profile Visit nmallare's homepage!
 
Closed Thread     « Reply to Getting error when everything looks right.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13928 seconds with 12 queries