php - Pulling data from MySQL only if a certain field is not empty -


I am trying to use the WHERE statement to draw that information where the field t.twittername < / Code> is not empty. The code below does not work. What type of WHERE statement can I use?

Edit: I tried WHERE t.twittername is not empty but that still does not work

Edit: I'm now showing the full SQL statement

Here's the SQL Tweets :

  Do not create 'tweets' (`tattid` not big (11) no zero AUTO_INCREMENT,` city` varchar (100) character set zero not latin1, `submissionid` varchar (11) character set zero not latin1,` shorturl` varchar 1000) Character set zero zero latin1, `loginid` varch (11) character set zero; latin1; `twittername` varchar (1000) character set not NULL,` time` not timestamp NULL default CURRENT_TIMESTAMP, primary key (`tweetid`) latin1   

Code:

  $ sqlStr3 = "l.username, l.loginid, t.tweetid, t.shorturl, t.twittername, t.time, s.submissionid, s.title, s Select url, s. DisplayURL, s.datesubmitted, s.points, COUNT (t.tweetid) Tweets t as countTweets ou TRIM (t.twittername) is not zero and trim (t.twittername)! = '' Internal login included as L on T. LoginID = l.loginid Join in submission as INNER by s.smmissionid = s.submissionid Group T.T.T.T.I.T. By T. Time DESC LIMIT $ offset, $ rowsperp age ";    

Try

  WHERE t.twittername is not zero   

edit - after comment:

Try this "Extreme" version to check a string field for:

  (t.twittername) Where TRIM (t.twittername) is not zero and trim = ''   

Edit 2 - another point:

Your SQL statement is odd - but you can see s Can not see s and you use COUNT but I do not see Group B and I expect some kind of join Which I do not see ... please show the actual statement ...

Edit 3 - OP has shown the definition of the statement and table:

I should not really understand what this statement should generate, but try the following:

 Select  l.username, l.loginid, t.tweetid, t.shorturl, t.twittername, t.time, s.submissionid, s.title, s.url, s.displayurl, s.datesubmitted, Tweets from Tweets, Tweets (TTDETIIT) Tweets. TTSTS AS T Inner Joins Login When LT Login = L. Logged in INNER SS Permit. Submissionid = s.submissionid WHERE TRIM (t.twittername) IS no, null and trim (T.T.TV.T.)! = '' Group by L. UserName, L.Linid, T.T.T.I.T., T.Shortral, T.T.V., T.T.I.T., SSUMMIDID, STITAL, SR. , S.displayurl, s.datesubmitted, s.points by ORDER DESC LIMIT $ offset, $ rowsperpage    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -