SpankedNutz
Oct 19th 2005, 10:06 am
Hi there,
This is what I want to do. I want to have one template php with the mysql query below:
The idea is that i can call one template file without physically having the files on the server:
I have this defined at the top of the page:
$cat = array('clothes','electronics');
And this is the query i want to run:
ps. This part from the query doesn't work Niche='$cat'
If i change the Niche='$cat' to Niche='clothes' then it works.
$sql = "SELECT Sitename_open, Sitename_closed, Message, Niche, IF (CHAR_LENGTH(Message)>100,RPAD(LEFT(Message,50),53,'.'),Message) AS Message FROM xxxxxxx where Niche='$cat' ORDER BY `Sitename_open` ASC";
I hope someone can help me
This is what I want to do. I want to have one template php with the mysql query below:
The idea is that i can call one template file without physically having the files on the server:
I have this defined at the top of the page:
$cat = array('clothes','electronics');
And this is the query i want to run:
ps. This part from the query doesn't work Niche='$cat'
If i change the Niche='$cat' to Niche='clothes' then it works.
$sql = "SELECT Sitename_open, Sitename_closed, Message, Niche, IF (CHAR_LENGTH(Message)>100,RPAD(LEFT(Message,50),53,'.'),Message) AS Message FROM xxxxxxx where Niche='$cat' ORDER BY `Sitename_open` ASC";
I hope someone can help me