PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
danharibo
Forum Commoner
Posts: 76 Joined: Thu Aug 17, 2006 8:56 am
Post
by danharibo » Fri Dec 01, 2006 1:32 pm
I try to run this:
Code: Select all
$sql = "INSERT INTO contacts (fullname, Age, DOB, mf, Religion, Nationality, Height, HairColor, EyeColor,FacialFeatures, Tatoos, Bio, PICTURE) and php returns an error, nothing specific but its on that line, i can't see anything wrong with it.
danharibo
Forum Commoner
Posts: 76 Joined: Thu Aug 17, 2006 8:56 am
Post
by danharibo » Fri Dec 01, 2006 1:35 pm
Now i get an error on last line (24)
Code: Select all
if(isset($_FILES['file']))
{
move_uploaded_file ($_FILES['file'] ['tmp_name'],
"./uploads/"$_FILES['file'] ['name'])
}
Fractal
Forum Commoner
Posts: 54 Joined: Tue Aug 16, 2005 1:28 pm
Post
by Fractal » Fri Dec 01, 2006 1:50 pm
You're missing a . before $_FILES and after the "
danharibo
Forum Commoner
Posts: 76 Joined: Thu Aug 17, 2006 8:56 am
Post
by danharibo » Fri Dec 01, 2006 1:58 pm
now i'm getting an error at the }
Fractal
Forum Commoner
Posts: 54 Joined: Tue Aug 16, 2005 1:28 pm
Post
by Fractal » Fri Dec 01, 2006 2:00 pm
danharibo wrote: now i'm getting an error at the }
You're also missing the semi-colon
danharibo
Forum Commoner
Posts: 76 Joined: Thu Aug 17, 2006 8:56 am
Post
by danharibo » Fri Dec 01, 2006 2:02 pm
Its there now..
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Dec 01, 2006 5:43 pm
If php tells you "on line xyz" the cause of the error can be on that line ...or before.
Therefore
danharibo wrote: now i'm getting an error at the }
tells us almost nothing.
Fractal
Forum Commoner
Posts: 54 Joined: Tue Aug 16, 2005 1:28 pm
Post
by Fractal » Fri Dec 01, 2006 7:24 pm
volka wrote: If php tells you "on line xyz" the cause of the error can be on that line ...or before.
Therefore
danharibo wrote: now i'm getting an error at the }
tells us almost nothing.
The MySQL problem would be a good example in that case, otherwise.. The other error generally means you're missing a parenthese, square bracket, or curly bracket.
From my experience anyway.