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
MySQL vise uvjeta odjednom

 
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
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 19.06.2006 19:53    Post subject: MySQL vise uvjeta odjednom Add user to your forum ignore list Reply with quote

imam ovaj dio
Code:
$go = 1;
if (!empty($_GET['go'])) $go = $_GET['go'];
$query = "SELECT COUNT(*) AS numrows FROM portfolio ";
if (!empty($cat)) $query .= "WHERE (cat='$cat') ";
//if ($_COOKIE['filter'] == 'on') $query .= "AND (mature='0') ";
$result = mysql_query($query, $connect);
$myrow = mysql_fetch_array($result, MYSQL_ASSOC);
$total = $myrow['numrows'];
$offset = ($go - 1) * $ipp;
$query = "SELECT * FROM portfolio ";
if (!empty($cat)) $query .= "WHERE (cat='$cat') ";
//if ($_COOKIE['filter'] == 'on') $query .= "AND (mature='0') ";
$query .= "ORDER BY id DESC LIMIT $offset, $ipp";
$result = mysql_query($query, $connect);

ove zakomentirane linije predstavljaju problem. bez njih skripta radi sasvim normalno.
$total, $offset, $go i $ipp sluze da bi se prikazao odredjeni broj itema po stranici.
Back to top
View user's profile Send private message Visit poster's website Twitter profile
sime
Guest





PostPosted: 19.06.2006 20:12    Post subject: Reply with quote

Uf, muka mi kad vidim taj nered od php-a i bezbrojnih sql upita. A ti nel`chee vidim da imaš dara i da se kobeljaš :)) da naučiš što više toga, zašto ne onda napraviti korak naprijed i zagristi na nešto bolje. Ne mora bit baš taj, ali to je daleko najpromišljeniji i najbolji framework koji sam proba. Jedini problem je hosting :)

Weblog, portfolio, gallery itd., se složi za jedan dan u Djangu sve na račun generic views-a. Da, ne moraš znati napisati ni jednu jedinu liniju python coda za tako neke jednostavnije siteove. A kod ti jednostavno ne može biti čišći. Ja sam osobno napravia kompletan weblog sa arhivom, komentarima, rss i atom feeds-ima za jedan dan. Naravno, ne odmah i iz prve, ali nakon par tutoriala, siteova i dokumentacije, da.
Back to top
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 19.06.2006 20:18    Post subject: Add user to your forum ignore list Reply with quote

ako se dobro sjecam, nisam pitala da mi preporucite drugi framework. to sto se neki ne mogu odluciti u cemu da programiraju ne tice me se
Back to top
View user's profile Send private message Visit poster's website Twitter profile
sime
Guest





PostPosted: 19.06.2006 20:23    Post subject: Reply with quote

Biatch.
Back to top
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 19.06.2006 20:25    Post subject: Add user to your forum ignore list Reply with quote

and proud of it :>
Back to top
View user's profile Send private message Visit poster's website Twitter profile
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 19.06.2006 23:11    Post subject: Add user to your forum ignore list Reply with quote

ovako napamet
- jel mature nekakvo integerasto polje, ako je - probaj maknut jednostruke navodnike
- echoaj $query varijablu, pa ju c/paj ovdje
- sta znaci da "ne radi normalno" - baca error, ne vraca recorde, sta?

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 20.06.2006 11:41    Post subject: Add user to your forum ignore list Reply with quote

gledam, ništa ne kužim Confused

i za moj kod govore da je 'concise', ali ovo je previše Smile stavi koji razmak ili komentar ponegdje
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 20.06.2006 14:11    Post subject: Add user to your forum ignore list Reply with quote

mature je varchar(1)
baca error prilikom poziva kverija

ma nema veze, odustajem od tog featura ionako..
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 20.06.2006 16:12    Post subject: Add user to your forum ignore list Reply with quote

PHP izgleda OK... puno bi više pomoglo kad bi znali što radiš i kakva ti je schema Sad
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 20.06.2006 16:18    Post subject: Add user to your forum ignore list Reply with quote

pa ono... provjera dali user ima kuki sa informacijom je li filter uključen ili ne
ako je uključen, vadi iz baze samo one koji imaju oznaku da nisu mature
iz nekog razloga kveri mi ne prolazi.

mah kao što rekoh, odustala sam Confused
Back to top
View user's profile Send private message Visit poster's website Twitter profile
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 21.06.2006 15:52    Post subject: Add user to your forum ignore list Reply with quote

ako se ipak ne predajes...
- kopipejstaj error koji dobijes. i kopipejstaj cijelu $query varijablu
- zagrade oko uvjeta ti nisu potrebne (ali vjerojatno ne smetaju)
- da li je moguce da prvi uvjet (if(!empty($cat)) ... ne prodje, pa ti nigdje ne zapocne WHERE

_________________
Bolje biti malo lud, nego malo pametan.
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