
5/8/20
Friday 2:11pm
Date Posted: 5/8/20
Coding note: MySQL: When pulling results that contain duplicates you may want to use DISTINCT.
Example:
SELECT DISTINCT t1.ID, t2.ID from t1, t2
To use an array in a SELECT statement I used
t1.ID NOT IN ( '" . implode( "', '" , $hidden ) . "' )
ref
Example:
"SELECT DISTINCT t1.ID, t1.date, t1.summary, t1.title
FROM t1, t2
WHERE t2.cat_ID!=$name_ID
AND t2.cat_ID!=22
AND t2.art_ID=t1.ID
AND t1.ID NOT IN ( '" . implode( "', '" , $bad) . "' )
ORDER BY date DESC
LIMIT 0, 7";
TAGS: mysqlAll Memo Tags
allegory 1,
anime 1,
article 6,
audio 2,
bible 5,
books 3,
bug 23,
code 1,
commercial 1,
computer 15,
cooking 5,
election 6,
ereader 5,
fixed 12,
games 24,
grok 4,
habits 2,
hard to remember 1,
history 1,
home improvement 44,
keyboard shortcuts 1,
links 3,
memo blog 1,
mini-review 14,
moving 19,
music 1,
mysql 1,
news 35,
none 1895,
opera 69,
politics 11,
private 17,
quotes 1,
reformat hard drive 19,
sgopc 1,
site update 15,
site version 205,
sleep 3,
star wars 2,
story 4,
swtor 1,
texas 1,
vacation 5,
video 7,
website 26,
windows 10 1,
wishlist 3