Error with Valid? syntax

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

Post Reply
danharibo
Forum Commoner
Posts: 76
Joined: Thu Aug 17, 2006 8:56 am

Error with Valid? syntax

Post by danharibo »

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 »

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'])
}
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post by Fractal »

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 »

now i'm getting an error at the }
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post by Fractal »

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 »

Its there now..
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

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.
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post by Fractal »

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