View Full Version : T_VARIABLE When adding the Query string.

06-15-2006, 06:22 PM
I'm getting:
Parse error: syntax error, unexpected T_VARIABLE in /home/jiingo/public_html/upload.php on line 39

When I add the $query2, and $result2 lines below. Otherwise my script is working fine. Is there something I'm missing? They don't seen to be interfering with anything else in the code.

This is also the major part of the code, but there are a few other bits and pieces above this part which I can provide, although I don't think they are important (but could be i suppose!)

define ("DIRECTORY", "/home/jiingo/public_html/photos/$row[vardir]/$session->username/");

do {
while (!is_dir($dir)) {
$basedir = dirname($dir);
if ($basedir == '/' || is_dir($basedir))
} while ($dir != DIRECTORY);

$picname = $_FILES['userfile']['name'];
$uploadfile = $dir.$newpicname;

move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
CHMOD("$uploadfile", 0777)

$query2 = "INSERT INTO photo_manager SET filename='$newpicname'";


06-15-2006, 06:25 PM
Well to start with your missing a semi-colon after


and also one after

CHMOD("$uploadfile", 0777)

It could be them.

06-15-2006, 06:26 PM
Well to start with your missing a semi-colon after


It could be that.

It was the CHMOD!

Thanks! I'm still really new to PHP - but learning slowly! So it's hard for me to catch my errors sometimes.

06-15-2006, 06:32 PM
Thats fair enough, that is why there are people here to help!