Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cool11

macrumors 68000
Original poster
Sep 3, 2006
1,781
220
I open this topic to get some help in basic tasks I want to accomplish with code, mainly in php/mysql.
I do not know programming but I have long computer experience and I still prefer to use visual editors for developing semi-amateur/professional web sites.

So, my first question is how to add an additional php command,
to narrow more my selection of database records.
I have a few lines code with 'where' and 'order' expressions,
but this is not enough for me, as I want to particularly select from these records, the ones with the field/tag named/equivalent with specific value.
For example, I want to additionally select the records with the 'tag'(field)='culture'.
So, what is the additional express that can be added, to narrow my selection?
 

organicCPU

macrumors 6502a
Aug 8, 2016
828
287
Maybe something like this will work?
Code:
$sql = "SELECT * FROM table WHERE condition = 'whatever' AND tag = 'culture'";

EDIT: I missed the word additionally... try this one:
Code:
$sql = "SELECT * FROM table WHERE condition = 'whatever' OR tag = 'culture'";
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.