ckrudelux Posted March 8, 2009 Share Posted March 8, 2009 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 More sharing options...
jlhaslip Posted March 9, 2009 Share Posted March 9, 2009 Is 'article' a valid column name in the Table?see also: http://dev.mysql.com/doc/refman/5.1/en/str...ction_substring Link to comment Share on other sites More sharing options...
ckrudelux Posted March 9, 2009 Author Share Posted March 9, 2009 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 More sharing options...
jlhaslip Posted March 9, 2009 Share Posted March 9, 2009 Add this right after the Query is fetched: echo '<pre>';print_r( $query_latest );echo '</pre>'; And post the results here, please. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.