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

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...

 

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.