...

View Full Version : [help] most annoying error



jamietrent
12-24-2010, 02:25 AM
I have been working on this for like 3 hours and I cant figure it out.
So I thought I would let a Professional Try it.


I need a .php scriplet that does the following:


mysql_query("UPDATE `accounts` SET `donationpoints`='"+1000"' WHERE `id`='".$ACC."'") or die(mysql_error());

and after that it sends you to google.com automatically

But I can't get it right I keep getting this error
Parse error: parse error, expecting `','' or `';'' in C:\wamp\www\includes\ucp\donate1.php on line 38




Please Help Me

DJCMBear
12-24-2010, 02:43 AM
Could you show us more code or is that line 38 of the file?

jamietrent
12-24-2010, 02:48 AM
mysql_query("UPDATE `accounts` SET `donationpoints`='"+1000"' WHERE `id`='".$ACC."'") or die(mysql_error());
is line 38

DJCMBear
12-24-2010, 02:53 AM
What are you adding 1000 to?

jamietrent
12-24-2010, 02:57 AM
my database

jamietrent
12-24-2010, 02:58 AM
yes I have include "config.php"
everything else is fine except for that line for some reason

DJCMBear
12-24-2010, 03:00 AM
No I mean are you trying to add 1000 to the current number in the database?

jamietrent
12-24-2010, 03:01 AM
no, im adding it to a row

DJCMBear
12-24-2010, 03:05 AM
Yes but has the cell donationpoints got a number in it already?

jamietrent
12-24-2010, 03:06 AM
yes 0

DJCMBear
12-24-2010, 03:08 AM
Try this out.



$result = mysql_query("SELECT `donationpoints` FROM `accounts` WHERE `id` = '{$ACC}'") or die(mysql_error());
if(mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$total = $row['donationpoints']+1000;
mysql_query("UPDATE `accounts` SET `donationpoints` = '{$total}' WHERE `id` = '{$ACC}'") or die(mysql_error());
}
}

jamietrent
12-24-2010, 03:08 AM
ok hold on a sec let me try it

jamietrent
12-24-2010, 03:10 AM
I still get that error

DJCMBear
12-24-2010, 03:12 AM
PM me a link to the code so I can see a live demo view.

jamietrent
12-24-2010, 03:14 AM
OK
let me restart from the beggining

I am tring to run a private server that holds there account information in mysql.

I am making a donation page to when they click there ammount(already did this part)
it sends them to paypal after that checkout with paypal. there sent to a link that aoutmatically gives them the 1000 donation points and sends them to the homepage cryptonyt.tk.

but the only problem is adding the donation points to the account. we dont have there account name.

jamietrent
12-24-2010, 03:17 AM
you have to login to the website to get to the download page. after you donate you should be still logged in.

I need a .php file to get this code to work .getInfo('accname', 'butsags_session', 'accid'). to get the account name from main.php.

ill upload the main.php

jamietrent
12-24-2010, 03:17 AM
<?php

/*ŻŻŻŻ|ŻŻŻŻŻ|ŻŻŻŻŻŻŻŻ|ŻŻŻ|ŻŻŻ||ŻŻŻ|ŻŻŻ|ŻŻŻŻŻŻŻŻ|ŻŻŻŻŻŻ|ŻŻŻŻ*\
|###########################################|
|#_____________________..ButsagsCMS.._____________________#|
|#______.Copyright İ2000-2009 Chris Ingis. All Rights Reserved._____#|
|###########################################|
\*____|_____|________|___|___||___|___|________|______|____*/



if(isset($_GET['page'])){
$ucp = $_GET['page'];
}else{
$ucp = "";
}

if(isset($_SESSION['id'])){
if($getbutsags == "ucp"){
if($ucp == ""){
echo "



<div id=\"mainbody\">
<tr>
<td>
<tr>
<td>

<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td valign=\"top\" width=\"100%\">
<fieldset>
<legend align='center'>
<b>Welcome to ".$servername.", ".getInfo('accname', 'butsags_session', 'accid')."</b>
</legend>";
?>
<marquee BEHAVIOR=ALTERNATE>
<?php echo $message?>
</marquee>
</center>
<?php
echo "
<table border=\"0\" width=\"100%\">
<tr>
<td width=\"100%\">
<table border=\"0\" width=\"100%\">
<tr>
<td width=\"100%\" align='center'>
<fieldset class=\"inner\">
<legend align='center'>
<b>User Tools</b>
</legend>
<input type=\"button\" style=\"width:25%;\" value=\"Get Donation Points\" onclick=\"location.href='?butsags=ucp&amp;page=donate';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Account Settings\" onclick=\"location.href='?butsags=ucp&amp;page=accset';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Character Fixes\" onclick=\"location.href='?butsags=ucp&amp;page=charfix';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Buy NX Cash\" onclick=\"location.href='?butsags=ucp&amp;page=buynx';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Log a Ticket\" onclick=\"location.href='?butsags=ucp&amp;page=ticket';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Screenshots\" onclick=\"location.href='?butsags=ucp&amp;page=album';\" /><br>";
if($_SESSION['pname'] == NULL){
echo "
<input type=\"button\" style=\"width:25%;\" value=\"Set Up a Profile Name\" onclick=\"location.href='?butsags=ucp&amp;page=profname';\" /><br>";
}else{
echo "
<input type=\"button\" style=\"width:25%;\" value=\"Edit Public Profile\" onclick=\"location.href='?butsags=ucp&amp;page=profedit';\" /><br>";
}
echo "
</fieldset>
</td>
<tr>
<td align=\"center\">
<fieldset class=\"inner\">
<legend align='center'>
<b>Community</b>
</legend>
<input type=\"button\" style=\"width:25%;\" value=\"Server Info\" onclick=\"location.href='?butsags=main&amp;page=info';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Server Staff\" onclick=\"location.href='?butsags=main&amp;page=staff';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"".$servername." Mail\" onclick=\"location.href='?butsags=ucp&amp;page=mail';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Rankings\" onclick=\"location.href='?butsags=main&amp;page=ranking';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Members\" onclick=\"location.href='?butsags=main&amp;page=members';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Guilds\" onclick=\"location.href='?butsags=main&amp;page=guildlist';\" /><br>
<input type=\"button\" style=\"width:25%;\" value=\"Banned Members\" onclick=\"location.href='?butsags=main&amp;page=banned';\" /><br>

</fieldset>
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</td>
</tr>";
}elseif($ucp == "accset"){
include('includes/ucp/account-settings.php');
}elseif($ucp == "buynx"){
include('includes/ucp/buynx.php');
}elseif($ucp == "donate"){
include('includes/ucp/donate.php');
}elseif($ucp == "charfix"){
include('includes/ucp/charfix.php');
}elseif($ucp == "profedit"){
include('includes/ucp/profile-edit.php');
}elseif($ucp == "profname"){
include('includes/ucp/profile-name.php');
}elseif($ucp == "mail"){
include('includes/ucp/mail.php');
}elseif($ucp == "ticket"){
include('includes/ucp/ticket.php');
}elseif($ucp == "album"){
include('includes/ucp/album.php');
}
}else{
header("Location: ?butsags=ucp");
}
}else{
include('includes/public/login.php');
}
?>

look at this line <b>Welcome to ".$servername.", ".getInfo('accname', 'butsags_session', 'accid')."</b> at the .getInfo('accname', 'butsags_session', 'accid')."

which is the account name.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum