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 Edit: I tried Edit: I'm now showing the full SQL statement Here's the SQL Code: Try edit - after comment: Try this "Extreme" version to check a string field for: Edit 2 - another point: Your SQL statement is odd - but you can see 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: t.twittername < / Code> is not empty. The code below does not work. What type of WHERE statement can I use?
WHERE t.twittername is not empty but that still does not work
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
$ 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 ";
WHERE t.twittername is not zero
(t.twittername) Where TRIM (t.twittername) is not zero and trim = ''
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 ...
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
Post a Comment