php - SQL query INSERT not working inserting values into my DB -


i'm trying insert values db it's not working, i'm trying figure out why it's not working i'm amateur php coder,

this code i'm using:

$insert = mysql_query     ("     insert news(id,title,body,date,by)     values ('null','".$title."','".$body."','".$date."','".$by."')     ");     mysql_close($connect); 

and rows i'm trying insert are: id,title,body,date,by
it's not showing in database or on news page.

can please me?

by special keyword. try wrapping column names in tick marks:

insert news(`id`,`title`,`body`,`date`,`by`) 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -