Author Topic: SOMEONE HELP  (Read 1265 times)

Offline PROMO

  • Level 6
  • *
  • Posts: 22
  • Reputation: +0/-0
    • View Profile
SOMEONE HELP
« on: February 20, 2008, 06:00:19 PM »
I get this error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/thema57/public_html/jobs.php on line 51

this is my code:
Quote
if ($user_class->job != 0){

$result = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$user_class->job."' ORDER BY `money`");

    $worked = mysql_fetch_array($result);
   
   echo "<div id="right_c"><!-- [ Powered by Mr. Whale's ezRPG ] !-->
<div class="g_content"><h3>&nbsp;&nbsp;Current Job</h3><div class="g_text">You are currently a ".$worked['name'].".
<br>
<br>
You gain the following per day:<br>

         - $.$worked['money'].<br>
         - .$worked['expgain']. Work EXP<br>

         <a href='jobs.php?action=quit'>Quit Job</a>";
      }
      </div></div>
?>

Offline PROMO

  • Level 6
  • *
  • Posts: 22
  • Reputation: +0/-0
    • View Profile
Re: SOMEONE HELP
« Reply #1 on: February 20, 2008, 06:01:11 PM »
someone tell me whats wrong and fix it for me? please

thank you.

Offline leZourite

  • Level 12
  • *
  • Posts: 81
  • Reputation: +2/-0
    • View Profile
    • After doomsday
Re: SOMEONE HELP
« Reply #2 on: February 20, 2008, 06:47:21 PM »
remove the first  "$" in :

  - $.$worked['money'].<br>

Offline Forgotten

  • Level 6
  • *
  • Posts: 21
  • Reputation: +0/-0
    • View Profile
    • ThunderWars Gaming
Re: SOMEONE HELP
« Reply #3 on: February 20, 2008, 06:58:31 PM »
I don't think that's his problem.... you should escape the " in your code though.

Such as:

 echo "<div id="right_c"><!-- [ Powered by Mr. Whale's ezRPG ] !-->
<div class="g_content"><h3>&nbsp;&nbsp;Current Job</h3><div class="g_text">You are currently a ".$worked['name'].".
<br>

needs to be:

 echo "<div id=\"right_c\"><!-- [ Powered by Mr. Whale's ezRPG ] !-->
<div class=\"g_content\"><h3>&nbsp;&nbsp;Current Job</h3><div class=\"g_text\">You are currently a ".$worked['name'].".
<br>

Offline leZourite

  • Level 12
  • *
  • Posts: 81
  • Reputation: +2/-0
    • View Profile
    • After doomsday
Re: SOMEONE HELP
« Reply #4 on: February 20, 2008, 07:31:03 PM »
that too, yeah the $ sign was just to show how much was gained, well spoted

Offline PROMO

  • Level 6
  • *
  • Posts: 22
  • Reputation: +0/-0
    • View Profile
Re: SOMEONE HELP
« Reply #5 on: February 21, 2008, 05:36:00 PM »

  - $.$worked['money'].<br>

that is to call my money value example.


  - $.$worked['money']. would call as -$600 <---- or whatever the amount u earned.

i think the problem was to escape the "

Offline ZadoAsh

  • Level 10
  • *
  • Posts: 62
  • Reputation: +0/-0
    • View Profile
    • Families of New York
Re: SOMEONE HELP
« Reply #6 on: June 03, 2008, 05:34:59 AM »
Hmmm How about this:

Code: [Select]
<?
if ($user_class->job != 0){

$result = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$user_class->job."' ORDER BY `money`");

    $worked = mysql_fetch_array($result);
   
   echo "<div id=\"right_c\"><!-- [ Powered by Mr. Whale's ezRPG ] !-->
<div class=\"g_content\"><h3>&nbsp;&nbsp;Current Job</h3><div class=\"g_text\">You are currently a {$worked['name']}.
<br>
<br>
You gain the following per day:<br>

         - ${$worked['money']}<br>
         - {$worked['expgain']} Work EXP<br>

         <a href='jobs.php?action=quit'>Quit Job</a>";
      }
     echo"</div></div>";
?>

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal