[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 06-27-2005, 08:26 PM   #1 (permalink)
New Member
 
Join Date: Aug 2004
Location: Auburn, AL
Posts: 15
30.00 NP$ (Donate)

efriese is an unknown quantity at this point


Parse error: parse error, unexpected $

Getting this error: "Parse error: parse error, unexpected $ on line 41". I've looked at this code, but I know I'm missing something. Thanks in advance!

PHP Code:
<?
printLog
("++++++ Constructing invoice records");
$now = date("YmdHis",$TIME);
$now2 = date("Ymd",$TIME);
$dbquery = "SELECT * FROM PHP_AUCTION_auctions
            WHERE ends <='$NOW'
            AND ((closed='0')
            OR (closed='1')
                AND reserve_price > 0
                AND num_bids > 0
                AND current_bid < reserve_price
                AND sold='s'))"
;

$get_auctions = mysql_query($dbquery);

$auc_num = mysql_num_rows($get_auctions);

if (
$auc_num > 0) {
    while(
$a = mysql_fetch_array($get_auctions)){
    
extract($a);

    
$auction_ID = $ID;
    
$fee = $current_bid*0.08;
    
$fee_rounded = round($fee,2);

    
$record = mysql_query("INSERT INTO PHPAUCTION_invoices VALUES ('NULL','$auction_ID','$user','$fee_rounded','$NOW')");
    
//log results
    
printLog("++++++ Invoicing Successful!");
}
?>
efriese is offline  
Old 06-27-2005, 08:29 PM   #2 (permalink)
Account Closed
 
axilant's Avatar
 
Join Date: May 2004
Location: /etc/passwd
Posts: 2,194
0.00 NP$ (Donate)

axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold


Its pretty aparent that that is not the full code

Post it all...

If you really want to help give me a url... to the file with the error
and copy that file and make it a .phps so i can see the source.
axilant is offline  
Old 06-27-2005, 11:37 PM   #3 (permalink)
Senior Member
 
Kodeking's Avatar
 
Join Date: Jun 2003
Location: Naperville Illinois
Posts: 1,803
658.75 NP$ (Donate)

Kodeking is just really niceKodeking is just really niceKodeking is just really niceKodeking is just really nice


Full code doesn't matter. He is missing an instance of the closing brackets: }

Stick another } at the end, or where you want the while loop to close.
__________________
Quote:
Clan-Forums.com >> $30 BoardingForum.com >> $100
TalkWebHosting.com >> $200 AvoidChapter13.com >> $100
Send PM to make lesser offers on the above names.
Kodeking is offline  
Old 06-28-2005, 02:34 AM   #4 (permalink)
Senior Member
 
Porte's Avatar
 
Join Date: May 2005
Location: Somewhere on earth!
Posts: 3,528
21.30 NP$ (Donate)

Porte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud of


As KodeKing mentiond so your code should be:

Quote:
if ($auc_num > 0) {
while($a = mysql_fetch_array($get_auctions)){
extract($a);

$auction_ID = $ID;
$fee = $current_bid*0.08;
$fee_rounded = round($fee,2);

$record = mysql_query("INSERT INTO PHPAUCTION_invoices VALUES ('NULL','$auction_ID','$user','$fee_rounded','$NOW ')");
//log results
printLog("++++++ Invoicing Successful!");
}
}
?>
Porte is offline  
Old 06-28-2005, 04:55 AM   #5 (permalink)
New Member
 
Join Date: Aug 2004
Location: Auburn, AL
Posts: 15
30.00 NP$ (Donate)

efriese is an unknown quantity at this point


That did the trick. Thanks!
efriese is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP parse error! Help please? drmaximus Programming 10 04-07-2004 06:36 PM
PHP Parse Error... do you see it? Jeanco Programming 8 12-31-2003 01:33 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 12:27 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85