Jump to content

Mysql Php Mid() Function Or Something Else?


ckrudelux

Recommended Posts

Hello again..Was wondering about some code..

$query_limit = mysql_query("SELECT MID(article,1,100) FROM articles WHERE type='article' AND country='$lang' ORDER BY article_id DESC LIMIT 1");

W3schools "mid()"Found this function on w3s and I don't get it to work.if you have an other solution on how to get the first 100 letters from the article that is in my database

Link to comment
Share on other sites

Is 'article' a valid column name in the Table?see also: http://dev.mysql.com/doc/refman/5.1/en/str...ction_substring
Yes and using this some rows above and this line works:
$query_latest = mysql_query("SELECT * FROM articles WHERE type='article' AND country='$lang' ORDER BY article_id DESC LIMIT 1");

Edit:all I get from the mid code is noting I don't get anything I don't get any errors it's just blank

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...