[text]
mysql_query("SET NAMES 'utf8'");
$sql431=mysql_query("SELECT * FROM categories,pages WHERE categories.Id AND pages.thecategory =".$arts_id);
$resulttitle=mysql_fetch_assoc($sql431);
[/text]
i have a page with a
.php?cat=here the $arts_id
and i have :
[text]if(isset($_GET['cat']))
$arts_id = $_GET['cat'];[/text]
but i cant get the title of the category
--
all the names of tables and fields are right!
i have a sql problem :\
Moderator: General Moderators
Re: i have a sql problem :\
Code: Select all
WHERE categories.IdRe: i have a sql problem :\
I will say ... "In your code context probably is incomplete and with not meaning at all" .... valid?... syntactically it isCelauran wrote:is not a valid WHERE clause.
Re: i have a sql problem :\
Yes, you've explained it better.
Re: i have a sql problem :\
ok i changed it to
[text]"SELECT * FROM categories LEFT JOIN pages ON categories.Id = pages.thecategory"[/text]
i get the first category name...but the anothers...i get the same title of the first category
[text]"SELECT * FROM categories LEFT JOIN pages ON categories.Id = pages.thecategory"[/text]
i get the first category name...but the anothers...i get the same title of the first category