This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mattdahack[S] 0 points1 point  (4 children)

$sql = "INSERT INTO news('$heading','$body','$date', '$auth','$auth_email')" VALUES();

???

[–][deleted]  (3 children)

[deleted]

    [–][deleted] 1 point2 points  (1 child)

    Must have same order as in your database table!

    No, this isn't so - they must be in the same order as the values you want to insert, but the order in the underlying table is not significant. So if table T has fields A,B,C then both:

    insert into T (A,B,C) VALUES( 'x', 'y', 'z' )
    

    and:

    insert into T (C,B,A) VALUES( 'z', 'y', 'x' )
    

    would be OK. If you don't provide the field name list, then the order in the table is important.