• I want to thank all the members that have upgraded your accounts. I truly appreciate your support of the site monetarily. Supporting the site keeps this site up and running as a lot of work daily goes on behind the scenes. Click to Support Signs101 ...

Error in my PHP script

Locals Find!

New Member
Can anyone help me I keep getting the following error in my php upload script when I run it.

Parse error: syntax error, unexpected T_VARIABLE in D:\hosting\6439177\html\testbed\upload.php on line 8

Here is a copy of the code

<html>
<head>
</head>
<body>
<?php
mysql_connect("removed", "removed", "removed") or die(mysql_error());
mysql_select_db("removed")
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$result=MYSQL_QUERY("INSERT INTO uploads (description, data,filename,filesize,filetype) ". "VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')");
$id= mysql_insert_id();
print "<p>File ID: <b>$id</b><br>";
print "<p>File Name: <b>$form_data_name</b><br>";
print "<p>File Size: <b>$form_data_size</b><br>";
print "<p>File Type: <b>$form_data_type</b><p>";
print "To upload another file <a href=http://www.removed> Click Here</a>";
?>
</body>
</html>
 

oldgoatroper

Roper of Goats. Old ones.
probably cuz you don' have the right params in your mysql connect and select statements...


















:ROFLMAO: <snork, snork>


(sorry, Addy... couldn't resist...)
 
Last edited:

Locals Find!

New Member
It's ok. I can only laugh at this point. I think I need to find another hobby lol. Trying to learn this programming stuff gives me more headaches than enjoyment lately.
 

JoshLoring

New Member
Could be wrong... but it looks like your missing the concatenator in the parameters. Within '$data, $etc, $etc' should be '.$data, .$etc, .$etc'
 

qmr55

New Member
Definitely missing concatenator and also looks like you're missing the terminating semi-colon on the "mysql_select_db("removed")" line.
 

GVP

New Member
If I add the missing semicolon to the "mysql_select_db("removed")" line, my system reports "no syntax errors".
 
Top