Jump to content

Mysql Php Mid() Function Or Something Else?


ckrudelux
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...