Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Problem s $_GET u SQL query

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
croatius



Joined: 02 Oct 2007
Posts: 34
Location: pumpaona

PostPosted: 06.10.2007 19:26    Post subject: Problem s $_GET u SQL query Add user to your forum ignore list Reply with quote

Code:
if (@$_GET['cat']) {
$articleresult = $connector->query('SELECT * FROM `articles` WHERE `article-category` = ' . $_GET['cat'] . ' LIMIT 10');
   while ($row = $connector->fetchArray($articleresult)) {
echo $row['article-title']; //test
}


Ne mogu sloziti da mi npr $_GET = "rijec" radi, osim ako $_GET = broj. Tj radi jedino sa znamenkama inace dobijem mysql error. Moze malo help?
Back to top
View user's profile Send private message Visit poster's website
maXimus



Joined: 05 Dec 2005
Posts: 55
Location: Zagreb

PostPosted: 06.10.2007 23:15    Post subject: Add user to your forum ignore list Reply with quote

pa ako se radi o stringu onda on mora u navodnike ići, dakle nedostaju ti navodnici prije i poslije $_GET-a

još si i sam donekle napisao

Quote:
$_GET = "rijec" vs $_GET = broj
Back to top
View user's profile Send private message
PaNtHeR



Joined: 17 Sep 2003
Posts: 161

PostPosted: 06.10.2007 23:23    Post subject: Re: Problem s $_GET u SQL query Add user to your forum ignore list Reply with quote

Dobro kaže maximus, trebaš eskejpati navodnike, mislim da treba biti ovako:

Code:
if (@$_GET['cat']) {
$articleresult = $connector->query('SELECT * FROM `articles` WHERE `article-category` = \'' . $_GET['cat'] . '\' LIMIT 10');
   while ($row = $connector->fetchArray($articleresult)) {
echo $row['article-title']; //test
}
Back to top
View user's profile Send private message Send e-mail
croatius



Joined: 02 Oct 2007
Posts: 34
Location: pumpaona

PostPosted: 07.10.2007 17:34    Post subject: Add user to your forum ignore list Reply with quote

tenk ju Wink
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group