Jump to content

[SOLVED] Parse error: syntax error, unexpected T_VARIABLE


Thomisback

Recommended Posts

I know it has already been asked a lot of times & of course I googled this error first but could not figure out the answer.

 

The line which gives me the error is:

$rOCrime = mysql_query('SELECT wapenexpert,leader,chauffeur,auto,wapen FROM $oc WHERE gamename='$prefix' AND id = '.intval($_GET['id']));

 

If anyone knows how to fix this, please let me know!

 

Thank you,

 

~ Thomisback

Link to comment
Share on other sites

You are having a couple of problems with your quotes....

try this...

<?php
$qry = "SELECT wapenexpert,leader,chauffeur,auto,wapen FROM " . $oc . " WHERE gamename='" . $prefix . "' AND id = " . intval($_GET['id']);
$rOCrime = mysql_query($qry);
?>

 

Much easier to read what you are trying to do

This method you can echo out your query to check errors in your mysql admin app...

 

Link to comment
Share on other sites

You are having a couple of problems with your quotes....

try this...

<?php
$qry = "SELECT wapenexpert,leader,chauffeur,auto,wapen FROM " . $oc . " WHERE gamename='" . $prefix . "' AND id = " . intval($_GET['id']);
$rOCrime = mysql_query($qry);
?>

 

Much easier to read what you are trying to do

This method you can echo out your query to check errors in your mysql admin app...

 

 

Thanks a lot, that worked!

 

Sadly I have got another error in this file now, it is a similar one to the one above, I will try to figure it out.

<?php
mysql_query("UPDATE " . $oc . " SET wapen = '.$iWapen.' WHERE gamename='" . $prefix . "' AND id = " . intval($_GET['id']);
?>

 

But I get:

Parse error: syntax error, unexpected ';'

 

I don't see what's wrong with my code... I think I missed out (several) "s?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.