Hello I am new in this Forum and I am begginner in PHP, I just followed a web tutorial about php and dreamweaver, I found a
error sintax in the followed code, I dont to know, what is the mistake, if somebody can help, I will appreciate.
this is the lines of code,
-----------------------------------------------------------------------------------------------------------------------
$query_getdisplay ="SELECT news.title, news.blog_entry, DATE_FORMAT(news.updated, '%M %e, %Y')
AS formatted FROM newsORDER BY news.updated DESC LIMIT 2";
)
$getdisplay = mysql_query($query_getdisplay, $check_mag) or die(mysql_error());
$row_getdisplay = mysql_fetch_assoc($getdisplay);
$totalRows_getdisplay = mysql_num_rows($getdisplay);
------------------------------------------------------
the sintax error, appear in the line: AS formatted FROM newsORDER BY news.update DESC LIMIT 2" ';
Thanks for any help.
Petite
Help in sintax error
Moderator: General Moderators
Re: Help in sintax error
Maybe newsORDER needs a space? Does it work then?
Re: Help in sintax error
I agree with Dodon. Since news seems to be the table you are using for your query you should separate it with ORDER BY.
Re: Help in sintax error
Hello, guys. thanks for your help, I dont know, if I understood good. I just separated ORDER BY, from news.
but still there is a sintax error. in the line of code.
Any other suggestions?
Thanks.
Petite
but still there is a sintax error. in the line of code.
Any other suggestions?
Thanks.
Petite
Re: Help in sintax error
Well I also see an extra parenthesis
AS formatted FROM newsORDER BY news.updated DESC LIMIT 2";
)
$getdisplay = mysql_query($query_getdisplay, $check_mag) or die(mysql_error());
maybe you should remove it so that i can look like this
AS formatted FROM newsORDER BY news.updated DESC LIMIT 2";
$getdisplay = mysql_query($query_getdisplay, $check_mag) or die(mysql_error());
But its difficult to tell if you are using that parenthesis with some code that you are not providing. Try removing the parenthesis if you are not using it with anything else.
AS formatted FROM newsORDER BY news.updated DESC LIMIT 2";
)
$getdisplay = mysql_query($query_getdisplay, $check_mag) or die(mysql_error());
maybe you should remove it so that i can look like this
AS formatted FROM newsORDER BY news.updated DESC LIMIT 2";
$getdisplay = mysql_query($query_getdisplay, $check_mag) or die(mysql_error());
But its difficult to tell if you are using that parenthesis with some code that you are not providing. Try removing the parenthesis if you are not using it with anything else.